xuhy
6 天以前 61ba04eb1338b3c25d50e1eff336433d82e1d1fe
问题上报接口
7个文件已修改
56 ■■■■ 已修改文件
ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TCrmBranchController.java 15 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TErpIssueReportingController.java 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-common/src/main/java/com/ruoyi/common/core/controller/FileController.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/java/com/ruoyi/system/model/TErpIssueReporting.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/java/com/ruoyi/system/query/TErpIssueReportingQuery.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TErpIssueReportingServiceImpl.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/resources/mapper/system/TErpIssueReportingMapper.xml 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TCrmBranchController.java
@@ -44,15 +44,17 @@
    private final ISysUserService sysUserService;
    private final TCrmChangePointsService crmChangePointsService;
    private final TCrmPositionService crmPositionService;
    private final TCrmSalespersonService crmSalespersonService;
    private final TokenService tokenService;
    @Autowired
    public TCrmBranchController(TCrmBranchService crmBranchService, TCrmBranchAreaService crmBranchAreaService, TCrmBranchSalaryService crmBranchSalaryService, ISysUserService sysUserService, TCrmChangePointsService crmChangePointsService, TCrmPositionService crmPositionService, TokenService tokenService) {
    public TCrmBranchController(TCrmBranchService crmBranchService, TCrmBranchAreaService crmBranchAreaService, TCrmBranchSalaryService crmBranchSalaryService, ISysUserService sysUserService, TCrmChangePointsService crmChangePointsService, TCrmPositionService crmPositionService, TCrmSalespersonService crmSalespersonService, TokenService tokenService) {
        this.crmBranchService = crmBranchService;
        this.crmBranchAreaService = crmBranchAreaService;
        this.crmBranchSalaryService = crmBranchSalaryService;
        this.sysUserService = sysUserService;
        this.crmChangePointsService = crmChangePointsService;
        this.crmPositionService = crmPositionService;
        this.crmSalespersonService = crmSalespersonService;
        this.tokenService = tokenService;
    }
@@ -74,9 +76,18 @@
        Integer roleType = tokenService.getLoginUser().getUser().getRoleType();
        Long userId = tokenService.getLoginUser().getUserId();
        LambdaQueryWrapper<TCrmBranch> wrapper = new LambdaQueryWrapper<>();
        if (roleType == 1) {
        if (roleType == 2) {
            wrapper.eq(TCrmBranch::getUserId, userId);
        }
        if(roleType == 3){
            // 查询业务员信息
            TCrmSalesperson crmSalesperson = crmSalespersonService.getOne(Wrappers.lambdaQuery(TCrmSalesperson.class)
                    .eq(TCrmSalesperson::getUserId, userId)
                    .last("LIMIT 1"));
            if(Objects.nonNull(crmSalesperson)){
                wrapper.eq(TCrmBranch::getId, crmSalesperson.getBranchId());
            }
        }
        wrapper.eq(TCrmBranch::getStatus,1).orderByDesc(TCrmBranch::getCreateTime);
        return R.ok(crmBranchService.list(wrapper));
    }
ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TErpIssueReportingController.java
@@ -5,6 +5,7 @@
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.basic.PageInfo;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.framework.web.service.TokenService;
import com.ruoyi.system.dto.TErpIssueReportingProcessDTO;
@@ -68,6 +69,22 @@
    @ApiOperation(value = "添加erp问题上报")
    @PostMapping(value = "/add")
    public R<Boolean> add(@Validated @RequestBody TErpIssueReporting dto) {
        Integer roleType = tokenService.getLoginUser().getUser().getRoleType();
        Long userId = tokenService.getLoginUser().getUserId();
        if(roleType == 4){
            dto.setReportType(1);
            TCrmSupplier crmSupplier = crmSupplierService.getOne(Wrappers.lambdaQuery(TCrmSupplier.class)
                    .eq(TCrmSupplier::getUserId, userId)
                    .last("LIMIT 1"));
            dto.setReportUserId(crmSupplier.getId());
        }
        if(roleType == 5){
            dto.setReportType(2);
            TCrmClinic crmClinic = crmClinicService.getOne(Wrappers.lambdaQuery(TCrmClinic.class)
                    .eq(TCrmClinic::getUserId, userId)
                    .last("LIMIT 1"));
            dto.setReportUserId(crmClinic.getId());
        }
        return R.ok(erpIssueReportingService.save(dto));
    }
ruoyi-common/src/main/java/com/ruoyi/common/core/controller/FileController.java
@@ -39,7 +39,7 @@
        }
        String TimeDir =new SimpleDateFormat("yyyy-MM-dd").format(new Date());
//        String realPath = fileUploadConfig.getLocation() + TimeDir;
        String realPath = "C:\\Users\\Admin\\Desktop\\qrcode\\" + TimeDir;
        String realPath = "E:\\Users\\Admin\\Desktop\\qrcode\\" + TimeDir;
        File file = new File(realPath);
        // 没有目录就创建
        if (!file.exists()) {
@@ -92,7 +92,7 @@
            return "请传入文件!";
        }
        String TimeDir =new SimpleDateFormat("yyyy-MM-dd").format(new Date());
        String realPath = "C:\\Users\\Admin\\Desktop\\qrcode\\" + TimeDir;
        String realPath = "E:\\Users\\Admin\\Desktop\\qrcode\\" + TimeDir;
        File file = new File(realPath);
        // 没有目录就创建
        if (!file.exists()) {
ruoyi-system/src/main/java/com/ruoyi/system/model/TErpIssueReporting.java
@@ -42,7 +42,7 @@
    @TableField("pictures")
    private String pictures;
    @ApiModelProperty(value = "处理状态 1=已处理 2=未处理")
    @ApiModelProperty(value = "处理状态 1=未处理 2=已处理")
    @TableField("status")
    private Integer status;
@@ -58,6 +58,10 @@
    @TableField("handler_person")
    private String handlerPerson;
    @ApiModelProperty(value = "处理图片")
    @TableField("handler_pictures")
    private String handlerPictures;
    @ApiModelProperty(value = "处理时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @TableField("handler_time")
ruoyi-system/src/main/java/com/ruoyi/system/query/TErpIssueReportingQuery.java
@@ -1,5 +1,6 @@
package com.ruoyi.system.query;
import com.baomidou.mybatisplus.annotation.TableField;
import com.ruoyi.common.core.domain.model.TimeRangeQueryBody;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
@@ -27,4 +28,6 @@
    @ApiModelProperty(value = "上报结束时间")
    private String reportEndTime;
    @ApiModelProperty(value = "处理人")
    private String handlerPerson;
}
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TErpIssueReportingServiceImpl.java
@@ -52,6 +52,7 @@
                    break;
                case 2:
                    crmClinics.stream().filter(t -> t.getId().equals(tErpIssueReportingVO.getReportUserId())).findFirst().ifPresent(t -> tErpIssueReportingVO.setSupplierClinicName(t.getClinicName()));
                    break;
            }
        }
        pageInfo.setRecords(list);
ruoyi-system/src/main/resources/mapper/system/TErpIssueReportingMapper.xml
@@ -14,6 +14,7 @@
        <result column="handler_person" property="handlerPerson" />
        <result column="handler_time" property="handlerTime" />
        <result column="handler_content" property="handlerContent" />
        <result column="handler_pictures" property="handlerPictures" />
        <result column="create_time" property="createTime" />
        <result column="update_time" property="updateTime" />
        <result column="create_by" property="createBy" />
@@ -24,7 +25,7 @@
    <!-- 通用查询结果列 -->
    <sql id="Base_Column_List">
        id, problem_title, report_content, pictures, status, report_type, report_user_id,handler_person,handler_time, handler_content,
          create_time, update_time, create_by, update_by, disabled
          handler_pictures,create_time, update_time, create_by, update_by, disabled
    </sql>
    <select id="pageList" resultType="com.ruoyi.system.vo.TErpIssueReportingVO">
        SELECT
@@ -43,13 +44,16 @@
            <if test="query.createBy != null and query.createBy != ''">
                AND create_by LIKE concat('%',#{query.createBy},'%')
            </if>
            <if test="query.handlerPerson != null and query.handlerPerson != ''">
                AND handler_person LIKE concat('%',#{query.handlerPerson},'%')
            </if>
            <if test="query.startTime != null and query.startTime != '' and query.endTime != null and query.endTime != ''">
                AND handler_time &gt;= #{query.startTime}
                AND handler_time &lt;= #{query.endTime}
            </if>
            <if test="query.reportStartTime != null and query.reportStartTime != '' and query.reportEndTime != null and query.reportEndTime != ''">
                AND create_time &gt;= #{query.startTime}
                AND create_time &lt;= #{query.endTime}
                AND create_time &gt;= #{query.reportStartTime}
                AND create_time &lt;= #{query.reportEndTime}
            </if>
            AND disabled = ${@com.ruoyi.common.enums.DisabledEnum@NO.getCode()}
        </where>