| | |
| | | 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; |
| | | } |
| | | |
| | |
| | | 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)); |
| | | } |
| | |
| | | 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; |
| | |
| | | @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)); |
| | | } |
| | | |
| | |
| | | } |
| | | 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()) { |
| | |
| | | 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()) { |
| | |
| | | @TableField("pictures") |
| | | private String pictures; |
| | | |
| | | @ApiModelProperty(value = "处理状态 1=已处理 2=未处理") |
| | | @ApiModelProperty(value = "处理状态 1=未处理 2=已处理") |
| | | @TableField("status") |
| | | private Integer status; |
| | | |
| | |
| | | @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") |
| | |
| | | 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; |
| | |
| | | @ApiModelProperty(value = "上报结束时间") |
| | | private String reportEndTime; |
| | | |
| | | @ApiModelProperty(value = "处理人") |
| | | private String handlerPerson; |
| | | } |
| | |
| | | break; |
| | | case 2: |
| | | crmClinics.stream().filter(t -> t.getId().equals(tErpIssueReportingVO.getReportUserId())).findFirst().ifPresent(t -> tErpIssueReportingVO.setSupplierClinicName(t.getClinicName())); |
| | | break; |
| | | } |
| | | } |
| | | pageInfo.setRecords(list); |
| | |
| | | <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" /> |
| | |
| | | <!-- 通用查询结果列 --> |
| | | <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 |
| | |
| | | <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 >= #{query.startTime} |
| | | AND handler_time <= #{query.endTime} |
| | | </if> |
| | | <if test="query.reportStartTime != null and query.reportStartTime != '' and query.reportEndTime != null and query.reportEndTime != ''"> |
| | | AND create_time >= #{query.startTime} |
| | | AND create_time <= #{query.endTime} |
| | | AND create_time >= #{query.reportStartTime} |
| | | AND create_time <= #{query.reportEndTime} |
| | | </if> |
| | | AND disabled = ${@com.ruoyi.common.enums.DisabledEnum@NO.getCode()} |
| | | </where> |