forked from gzzfw/backEnd/gz-dyh

zhouxiantao
2024-09-25 c9dfc82c1b2a51a4961c0c8c955bc646acf6b8cb
小程序是否可见控制
1 files added
2 files modified
67 ■■■■■ changed files
dyh-service/dyh-mediate/src/main/java/cn/huge/module/cases/dao/mapper/xml/CaseInfoMapper.xml 3 ●●●●● patch | view | raw | blame | history
dyh-service/dyh-mediate/src/main/java/cn/huge/module/cases/service/CaseInfoService.java 1 ●●●● patch | view | raw | blame | history
dyh-service/dyh-sys/src/main/java/cn/huge/module/grid/controller/wechat/GridCompanyWechatController.java 63 ●●●●● patch | view | raw | blame | history
dyh-service/dyh-mediate/src/main/java/cn/huge/module/cases/dao/mapper/xml/CaseInfoMapper.xml
@@ -398,6 +398,9 @@
                <if test="terms.id != null and terms.id !=''">
                    and id = #{terms.id}
                </if>
                <if test="terms.partyShow != null and terms.partyShow !=''">
                    and party_show = #{terms.partyShow}
                </if>
                <if test="terms.caseTitle != null and terms.caseTitle !=''">
                    and case_title = #{terms.caseTitle}
                </if>
dyh-service/dyh-mediate/src/main/java/cn/huge/module/cases/service/CaseInfoService.java
@@ -841,6 +841,7 @@
        }
        List<String> ids = casePersonList.stream().map(CasePerson::getCaseId).collect(Collectors.toList());
        terms.put("ids", ids);
        terms.put("partyShow",1);
        long total = mapper.countTerms(terms);
        List<CaseInfo> content = mapper.pageTerms(page, terms);
        if (ObjectUtils.isNotEmpty(content)) {
dyh-service/dyh-sys/src/main/java/cn/huge/module/grid/controller/wechat/GridCompanyWechatController.java
New file
@@ -0,0 +1,63 @@
package cn.huge.module.grid.controller.wechat;
import cn.huge.base.common.bo.R;
import cn.huge.base.common.utils.ObjectUtils;
import cn.huge.base.common.utils.ReturnFailUtils;
import cn.huge.base.common.utils.ReturnSucUtils;
import cn.huge.module.grid.domain.dto.GridCompanyDTO;
import cn.huge.module.grid.domain.vo.GridCompanyVo;
import cn.huge.module.grid.service.GridCompanyService;
import com.google.common.collect.Maps;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.util.Map;
@Slf4j
@RestController
@RequestMapping("/api/wechat/company")
public class GridCompanyWechatController {
    @Autowired(required = false)
    private HttpServletRequest request;
    @Resource
    private GridCompanyService gridCompanyService;
    @PostMapping("/get-company-list")
    public R<GridCompanyDTO> getCompanyList(@RequestBody GridCompanyVo gridCompanyVo) throws Exception {
        return gridCompanyService.getCompanyList(gridCompanyVo);
    }
    /**
     * 条件分页查询
     * @url {ctx}/api/wechat/company/pageQuery
     * @param page 页码
     * @param size 每页数量
     * @return Object
     */
    @GetMapping("/pageQuery")
    public Object pageQuery(@RequestParam(value = "page") int page, @RequestParam(value = "size") int size) {
        try {
            Map<String, Object> terms = Maps.newHashMap();
            GridCompanyVo gridCompanyVo = new GridCompanyVo();
            String integratedQuery = request.getParameter("integratedQuery");
            gridCompanyVo.setIntegratedQuery(integratedQuery);
            String state = request.getParameter("state");
            if(ObjectUtils.isNotEmpty(state)){
                gridCompanyVo.setState(Integer.valueOf(state));
            }
            String gridCode = request.getParameter("gridCode");
            gridCompanyVo.setGridCode(gridCode);
            gridCompanyVo.setPage(page);
            gridCompanyVo.setPageSize(size);
            gridCompanyVo.setNeedCount(true);
            return ReturnSucUtils.getRepInfo( "处理成功", gridCompanyService.pageQuery(gridCompanyVo));
        } catch (Exception e) {
            log.error("Controller接口[GridCompanyController.pageQuery]请求异常:"+e, e);
            return ReturnFailUtils.getRepInfo();
        }
    }
}