diff --git a/anomaly/pom.xml b/anomaly/pom.xml index 9afd3d68..1e828357 100644 --- a/anomaly/pom.xml +++ b/anomaly/pom.xml @@ -80,6 +80,10 @@ com.foreverwin.mesnac quality + + com.foreverwin.mesnac + listener + org.springframework.boot spring-boot-starter-quartz diff --git a/anomaly/src/main/java/com/foreverwin/mesnac/anomaly/controller/ReportController.java b/anomaly/src/main/java/com/foreverwin/mesnac/anomaly/controller/ReportController.java index 579ce61f..498cd634 100644 --- a/anomaly/src/main/java/com/foreverwin/mesnac/anomaly/controller/ReportController.java +++ b/anomaly/src/main/java/com/foreverwin/mesnac/anomaly/controller/ReportController.java @@ -95,4 +95,19 @@ public class ReportController { return R.failed(e.getMessage()); } } + + /** + * 质检问题统计表 + * @param paramMap + * @return + */ + @PostMapping("/findQualityInspectionReport") + public R findQualityInspectionReport(@RequestBody(required = false) Map paramMap) { + try{ + List> result = reportService.findQualityInspectionReport(paramMap); + return R.ok(result); + }catch (Exception e){ + return R.failed(e.getMessage()); + } + } } diff --git a/anomaly/src/main/java/com/foreverwin/mesnac/anomaly/mapper/ReportMapper.java b/anomaly/src/main/java/com/foreverwin/mesnac/anomaly/mapper/ReportMapper.java index e651f1ba..cc526a4c 100644 --- a/anomaly/src/main/java/com/foreverwin/mesnac/anomaly/mapper/ReportMapper.java +++ b/anomaly/src/main/java/com/foreverwin/mesnac/anomaly/mapper/ReportMapper.java @@ -27,4 +27,11 @@ public interface ReportMapper { List> findInspectionTask(Map paramMap); + + /** + * 查询质检问题统计表 + * @param paramMap + * @return + */ + List> findQualityInspectionReport(Map paramMap); } diff --git a/anomaly/src/main/java/com/foreverwin/mesnac/anomaly/service/ReportService.java b/anomaly/src/main/java/com/foreverwin/mesnac/anomaly/service/ReportService.java index 55bd2772..2a27f874 100644 --- a/anomaly/src/main/java/com/foreverwin/mesnac/anomaly/service/ReportService.java +++ b/anomaly/src/main/java/com/foreverwin/mesnac/anomaly/service/ReportService.java @@ -26,4 +26,11 @@ public interface ReportService { * @return */ List> findInspectionTask(Map paramMap); + + /** + * 查询质检问题统计表 + * @param paramMap + * @return + */ + List> findQualityInspectionReport(Map paramMap); } diff --git a/anomaly/src/main/java/com/foreverwin/mesnac/anomaly/service/impl/AbnormalBillServiceImpl.java b/anomaly/src/main/java/com/foreverwin/mesnac/anomaly/service/impl/AbnormalBillServiceImpl.java index afc6bd9a..fe82597d 100644 --- a/anomaly/src/main/java/com/foreverwin/mesnac/anomaly/service/impl/AbnormalBillServiceImpl.java +++ b/anomaly/src/main/java/com/foreverwin/mesnac/anomaly/service/impl/AbnormalBillServiceImpl.java @@ -27,6 +27,7 @@ import com.foreverwin.mesnac.common.service.*; import com.foreverwin.mesnac.common.util.ActiveMQUtil; import com.foreverwin.mesnac.common.util.DateUtil; import com.foreverwin.mesnac.common.util.StringUtil; +import com.foreverwin.mesnac.listener.mapper.UsrMapper; import com.foreverwin.mesnac.meapi.dto.NcCodeDto; import com.foreverwin.mesnac.meapi.mapper.*; import com.foreverwin.mesnac.meapi.model.*; @@ -155,6 +156,9 @@ public class AbnormalBillServiceImpl extends ServiceImpl selectPage(FrontPage frontPage, AbnormalBill abnormalBill) { @@ -1056,12 +1060,16 @@ public class AbnormalBillServiceImpl extends ServiceImpl customFieldByUserId = usrMapper.findCustomFieldByUserId(site, nwaUsers); + if(customFieldByUserId != null && customFieldByUserId.size() <= 0){ + throw new BaseException("消息发送失败,发送的用户组下面的自定义数据没有维护"); + } StringBuilder sendUsers = new StringBuilder(); - for (int i = 0; i < nwaUsers.size(); i++) { - if(i == (nwaUsers.size() - 1)){ - sendUsers.append(nwaUsers.get(i).getUserName()); + for (int i = 0; i < customFieldByUserId.size(); i++) { + if(i == (customFieldByUserId.size() - 1)){ + sendUsers.append(customFieldByUserId.get(i)); }else{ - sendUsers.append(nwaUsers.get(i).getUserName()).append("|"); + sendUsers.append(customFieldByUserId.get(i)).append("|"); } } activeMQUtil.wechatSendMessage(sendUsers.toString(),abnormalMessage.getContent()); diff --git a/anomaly/src/main/java/com/foreverwin/mesnac/anomaly/service/impl/ReportServiceImpl.java b/anomaly/src/main/java/com/foreverwin/mesnac/anomaly/service/impl/ReportServiceImpl.java index 93451546..ee76a14a 100644 --- a/anomaly/src/main/java/com/foreverwin/mesnac/anomaly/service/impl/ReportServiceImpl.java +++ b/anomaly/src/main/java/com/foreverwin/mesnac/anomaly/service/impl/ReportServiceImpl.java @@ -5,6 +5,7 @@ import com.foreverwin.mesnac.anomaly.mapper.ReportMapper; import com.foreverwin.mesnac.anomaly.service.ReportService; import com.foreverwin.mesnac.meapi.model.NcCode; import com.foreverwin.mesnac.meapi.model.NwaUser; +import com.foreverwin.mesnac.meapi.service.DataFieldListService; import com.foreverwin.mesnac.meapi.service.NcCodeService; import com.foreverwin.mesnac.meapi.service.NwaUserService; import com.foreverwin.mesnac.meapi.util.StringUtils; @@ -34,6 +35,8 @@ public class ReportServiceImpl implements ReportService { private ReportMapper reportMapper; @Autowired private NwaUserService nwaUserService; + @Autowired + private DataFieldListService dataFieldListService; /** * 接口日志表 @@ -145,4 +148,19 @@ public class ReportServiceImpl implements ReportService { public List> findInspectionTask(Map paramMap) { return reportMapper.findInspectionTask(paramMap); } + + /** + * 查询质检问题统计表 + * @param paramMap + * @return + */ + @Override + public List> findQualityInspectionReport(Map paramMap) { + String site = CommonMethods.getSite(); + paramMap.put("site",site); + paramMap.put("locale",LocaleContextHolder.getLocale().getLanguage()); + List> qualityInspectionReport = reportMapper.findQualityInspectionReport(paramMap); + + return null; + } } diff --git a/anomaly/src/main/resources/mapper/ReportMapper.xml b/anomaly/src/main/resources/mapper/ReportMapper.xml index 119d2999..d321f376 100644 --- a/anomaly/src/main/resources/mapper/ReportMapper.xml +++ b/anomaly/src/main/resources/mapper/ReportMapper.xml @@ -199,4 +199,70 @@ AND ZT.MODIFIED_DATE_TIME <= TO_DATE(#{startToDate}|| '23:59:59', 'YYYY-MM-DD HH24:MI:SS') + + \ No newline at end of file diff --git a/common/src/main/java/com/foreverwin/mesnac/common/dto/UsrDto.java b/common/src/main/java/com/foreverwin/mesnac/common/dto/UsrDto.java index f87af383..46adc93a 100644 --- a/common/src/main/java/com/foreverwin/mesnac/common/dto/UsrDto.java +++ b/common/src/main/java/com/foreverwin/mesnac/common/dto/UsrDto.java @@ -11,6 +11,8 @@ public class UsrDto { private String fullName; + private String wechatId; + public String getUserName() { return userName; } @@ -26,4 +28,12 @@ public class UsrDto { public void setFullName(String fullName) { this.fullName = fullName; } + + public String getWechatId() { + return wechatId; + } + + public void setWechatId(String wechatId) { + this.wechatId = wechatId; + } } diff --git a/listener/src/main/java/com/foreverwin/mesnac/listener/mapper/UsrMapper.java b/listener/src/main/java/com/foreverwin/mesnac/listener/mapper/UsrMapper.java index 3eda5db2..6bfb02ca 100644 --- a/listener/src/main/java/com/foreverwin/mesnac/listener/mapper/UsrMapper.java +++ b/listener/src/main/java/com/foreverwin/mesnac/listener/mapper/UsrMapper.java @@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage; import com.foreverwin.mesnac.common.dto.UsrDto; import com.foreverwin.mesnac.listener.model.SysUser; import com.foreverwin.mesnac.listener.model.Usr; +import com.foreverwin.mesnac.meapi.model.NwaUser; import org.apache.ibatis.annotations.Param; import org.springframework.stereotype.Repository; @@ -27,4 +28,7 @@ public interface UsrMapper extends BaseMapper { IPage findPage(IPage page,@Param("site")String site,@Param("user")String user); + List findCustomFieldByUserId(@Param("site")String site, @Param("userList")List userList); + + } \ No newline at end of file diff --git a/listener/src/main/resources/mapper/UsrMapper.xml b/listener/src/main/resources/mapper/UsrMapper.xml index f61d2226..7be74906 100644 --- a/listener/src/main/resources/mapper/UsrMapper.xml +++ b/listener/src/main/resources/mapper/UsrMapper.xml @@ -32,6 +32,7 @@ + @@ -636,4 +637,18 @@ ) + +