Helius
2021-06-28 4b85397fa2b5b98756752d6e922897b79aec08d8
modify
1 files added
6 files modified
92 ■■■■■ changed files
gc-core/src/main/java/com/xzx/gc/entity/JhyInfo.java 2 ●●● patch | view | raw | blame | history
gc-core/src/main/resources/application.properties 2 ●●● patch | view | raw | blame | history
gc-user/src/main/java/com/xzx/gc/user/controller/AdminJhyInfoController.java 15 ●●●●● patch | view | raw | blame | history
gc-user/src/main/java/com/xzx/gc/user/dto/JhyInfoListDto.java 25 ●●●●● patch | view | raw | blame | history
gc-user/src/main/java/com/xzx/gc/user/mapper/JhyInfoMapper.java 6 ●●●●● patch | view | raw | blame | history
gc-user/src/main/java/com/xzx/gc/user/service/JhyInfoService.java 25 ●●●● patch | view | raw | blame | history
gc-user/src/main/resources/mapper/user/JhyInfoMapper.xml 17 ●●●●● patch | view | raw | blame | history
gc-core/src/main/java/com/xzx/gc/entity/JhyInfo.java
@@ -31,7 +31,7 @@
    /**
     * 是否集物员 1-是 2-否
     */
    private String isJyh;
    private String isJhy;
    /**
     * 审核状态 1-待审核 2-审核通过 3-审核拒绝
gc-core/src/main/resources/application.properties
@@ -11,7 +11,7 @@
#log
project.log.path=/xzx/logs
project.log.path=xzx/logs
logstash.server.url=localhost:4560
#spring
gc-user/src/main/java/com/xzx/gc/user/controller/AdminJhyInfoController.java
@@ -1,11 +1,20 @@
package com.xzx.gc.user.controller;
import com.xzx.gc.common.constant.Constants;
import com.xzx.gc.common.request.BaseController;
import com.xzx.gc.model.JsonResult;
import com.xzx.gc.user.dto.JhyInfoListDto;
import com.xzx.gc.user.service.JhyInfoService;
import com.xzx.gc.user.vo.JhyInfoListVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import java.util.Map;
@RestController
@Api(tags = {"集物员--集物员管理"})
@@ -15,5 +24,9 @@
    @Autowired
    private JhyInfoService jhyInfoService;
    @ApiOperation(value = "集货员信息列表")
    @PostMapping(value = Constants.ADMIN_VIEW_PREFIX + "/jhy/list.json")
    public JsonResult<Map<String, Object>> jhyList(@RequestBody JhyInfoListDto jhyInfoListDto) {
        return JsonResult.success(jhyInfoService.queryList(jhyInfoListDto));
    }
}
gc-user/src/main/java/com/xzx/gc/user/dto/JhyInfoListDto.java
New file
@@ -0,0 +1,25 @@
package com.xzx.gc.user.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
@ApiModel(value = "JhyInfoListDto", description = "后台集货员列表接收参数类")
public class JhyInfoListDto {
    @ApiModelProperty(value = "第几页", required = true)
    private int page;
    @ApiModelProperty(value = "每一页数量", required = true)
    private int limit;
    @ApiModelProperty(value = "是否集货员 1-是2-否")
    private Integer isJhy;
    @ApiModelProperty(value = "查询字段")
    private String name;
    @ApiModelProperty(value = "审核状态 1-待审核 2-审核通过 3-审核拒绝")
    private Integer status;
}
gc-user/src/main/java/com/xzx/gc/user/mapper/JhyInfoMapper.java
@@ -1,8 +1,12 @@
package com.xzx.gc.user.mapper;
import com.xzx.gc.entity.JhyInfo;
import com.xzx.gc.user.dto.JhyInfoListDto;
import com.xzx.gc.user.vo.JhyInfoListVo;
import com.xzx.gc.util.GcMapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface JhyInfoMapper extends GcMapper<JhyInfo> {
@@ -13,4 +17,6 @@
    JhyInfo selectJhyInfoByUserId(@Param("userId") String userId);
    JhyInfo selectExistJhyByIndeityOrMobile(@Param("mobile") String mobile, @Param("identity") String Identity);
    List<JhyInfoListVo> selectJhyInfoList(@Param("record") JhyInfoListDto jhyInfoListDto);
}
gc-user/src/main/java/com/xzx/gc/user/service/JhyInfoService.java
@@ -1,15 +1,23 @@
package com.xzx.gc.user.service;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.convert.Convert;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.xzx.gc.common.exception.RestException;
import com.xzx.gc.entity.JhyInfo;
import com.xzx.gc.user.dto.JhyApplyDto;
import com.xzx.gc.user.dto.JhyInfoListDto;
import com.xzx.gc.user.mapper.JhyInfoMapper;
import com.xzx.gc.user.vo.JhyInfoListVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@Service
@Transactional
@@ -49,10 +57,19 @@
            return false;
        }
        if (JhyInfo.CHECK_PASS.equals(jhyInfo.getStatus())) {
            return true;
        }
        return JhyInfo.CHECK_PASS.equals(jhyInfo.getStatus());
    }
        return false;
    public Map<String, Object> queryList(JhyInfoListDto jhyInfoListDto) {
        PageHelper.startPage(jhyInfoListDto.getPage(), jhyInfoListDto.getLimit());
        List<JhyInfoListVo> jhyInfoListVos = jhyInfoMapper.selectJhyInfoList(jhyInfoListDto);
        PageInfo<JhyInfoListVo> pageInfo = new PageInfo<>(jhyInfoListVos);
        Map<String, Object> data = new HashMap<>();
        int count = Convert.toInt(pageInfo.getTotal());
        data.put("data", jhyInfoListVos);
        data.put("count", count);
        data.put("code", 0);
        return data;
    }
}
gc-user/src/main/resources/mapper/user/JhyInfoMapper.xml
@@ -17,4 +17,21 @@
    <select id="selectExistJhyByIndeityOrMobile" resultType="com.xzx.gc.entity.JhyInfo">
        select * from xzx_jhy_info where (mobile=#{mobile} or identity = #{identity}) and status in (1, 2)
    </select>
    <select id="selectJhyInfoList" resultType="com.xzx.gc.user.vo.JhyInfoListVo">
        select * from xzx_jhy_info
        <where>
            1=1
            <if test="record.name != null and record.name != ''">
                and (username like CONCAT(CONCAT(#{record.name}, '%'), '%') or phone=#{record.phone})
            </if>
            <if test="record.isJhy != null and record.name != ''">
                and is_jhy=#{record.isJhy}
            </if>
            <if test="record.status != null">
                and status = #{record.status}
            </if>
        </where>
        order by id desc;
    </select>
</mapper>