|
@@ -26,12 +26,14 @@ import com.platform.dao.dto.sb.SbInfoDTO;
|
|
|
import com.platform.dao.dto.store.InStoreFormDTO;
|
|
|
import com.platform.dao.dto.store.OutStoreFormDTO;
|
|
|
import com.platform.dao.dto.store.StoreCheckJobDTO;
|
|
|
+import com.platform.dao.dto.upms.SysDictDTO;
|
|
|
import com.platform.dao.dto.upms.SysUserDTO;
|
|
|
import com.platform.dao.entity.customize.CustomFieldTemplateData;
|
|
|
import com.platform.dao.entity.preparation.Preparation;
|
|
|
import com.platform.dao.entity.repair.RepairApplicationForm;
|
|
|
import com.platform.dao.entity.repair.RepairReason;
|
|
|
import com.platform.dao.entity.sb.SbInfo;
|
|
|
+import com.platform.dao.entity.upms.SysDict;
|
|
|
import com.platform.dao.entity.upms.SysFile;
|
|
|
import com.platform.dao.entity.upms.SysUser;
|
|
|
import com.platform.dao.enums.*;
|
|
@@ -43,6 +45,7 @@ import com.platform.dao.mapper.sb.SbPositionMapper;
|
|
|
import com.platform.dao.mapper.store.InStoreFormMapper;
|
|
|
import com.platform.dao.mapper.store.OutStoreFormMapper;
|
|
|
import com.platform.dao.mapper.store.StoreCheckJobMapper;
|
|
|
+import com.platform.dao.mapper.upms.SysDeptMapper;
|
|
|
import com.platform.dao.mapper.upms.SysUserDeptMapper;
|
|
|
import com.platform.dao.mapper.upms.SysUserMapper;
|
|
|
import com.platform.dao.mapper.upms.SysUserRoleMapper;
|
|
@@ -67,6 +70,7 @@ import com.platform.service.event.WorkplaceBacklogEvent;
|
|
|
import com.platform.service.repair.RepairApplicationFormService;
|
|
|
import com.platform.service.repair.RepairFormService;
|
|
|
import com.platform.service.sb.SbInfoService;
|
|
|
+import com.platform.service.upms.SysDictService;
|
|
|
import com.platform.service.upms.SysFileService;
|
|
|
import com.platform.service.upms.SysUserDeptService;
|
|
|
import com.platform.service.upms.SysUserService;
|
|
@@ -97,11 +101,8 @@ import java.util.stream.Collectors;
|
|
|
public class RepairApplicationFormServiceImpl extends BaseServiceImpl<RepairApplicationFormMapper, RepairApplicationForm, RepairApplicationFormDTO> implements RepairApplicationFormService {
|
|
|
|
|
|
private final CustomFieldTemplateDataMapper customFieldTemplateDataMapper;
|
|
|
- private RepairFormMapper repairFormMapper;
|
|
|
private RepairReasonMapper repairReasonMapper;
|
|
|
- private RepairCheckMapper repairCheckMapper;
|
|
|
private final SysUserService sysUserService;
|
|
|
- private final SysUserDeptService sysUserDeptService;
|
|
|
private final SbInfoService sbInfoService;
|
|
|
private final SysFileService sysFileService;
|
|
|
private final SysUserMapper userMapper;
|
|
@@ -109,13 +110,14 @@ public class RepairApplicationFormServiceImpl extends BaseServiceImpl<RepairAppl
|
|
|
private final SysUserRoleMapper sysUserRoleMapper;
|
|
|
private final CheckJobMapper checkJobMapper;
|
|
|
private final WorkplaceBacklogMapper workplaceBacklogMapper;
|
|
|
- private final ActivitiController activitiController;
|
|
|
private final InStoreFormMapper inStoreFormMapper;
|
|
|
private final OutStoreFormMapper outStoreFormMapper;
|
|
|
private final StoreCheckJobMapper storeCheckJobMapper;
|
|
|
private final SysUserDeptMapper sysUserDeptMapper;
|
|
|
private final SbPositionMapper sbPositionMapper;
|
|
|
private final PreparationMapper preparationMapper;
|
|
|
+ private final SysDeptMapper sysDeptMapper;
|
|
|
+ private final SysDictService sysDictService;
|
|
|
private final BigDecimal initNum= new BigDecimal(0);
|
|
|
|
|
|
|
|
@@ -676,6 +678,68 @@ public class RepairApplicationFormServiceImpl extends BaseServiceImpl<RepairAppl
|
|
|
mapper.deleteByPrimaryKey(id);
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public Map<Integer,RepairApplicationFormVO> countNumByDept(RepairApplicationFormDTO model) {
|
|
|
+ // 获取机械,仪表,电气
|
|
|
+ SysDictDTO query = new SysDictDTO();
|
|
|
+ query.setType("REPAIR_DEPT_CATEGORY");
|
|
|
+ List<SysDict> dicts = sysDictService.getModelListByDTO(query);
|
|
|
+ String jiXi = "";
|
|
|
+ String dianQi = "";
|
|
|
+ String yiBiao = "";
|
|
|
+ for(SysDict sysDict : dicts){
|
|
|
+ if(sysDict.getCode().equals("REPAIR_ONE")){
|
|
|
+ jiXi = sysDict.getValue();
|
|
|
+ }else if("REPAIR_TWO".equals(sysDict.getCode())){
|
|
|
+ dianQi = sysDict.getValue();
|
|
|
+ }else{
|
|
|
+ yiBiao = sysDict.getValue();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // 获取检索条件
|
|
|
+ List<Map<String, LocalDateTime>> monthStartAndEndList = ListUtils.newArrayList();
|
|
|
+ if (model.getSearchYear() != null) {
|
|
|
+ monthStartAndEndList = DateUtils.getMonthStartAndEndByYear(model.getSearchYear(), 12);
|
|
|
+ } else {
|
|
|
+ int year = LocalDate.now().getYear();
|
|
|
+ model.setSearchYear(year);
|
|
|
+ monthStartAndEndList = DateUtils.getMonthStartAndEndByYear(year, 12);
|
|
|
+ }
|
|
|
+ LocalDateTime searchStartTime = DateUtils.getFirstDayOfThisYear(model.getSearchYear());;
|
|
|
+ LocalDateTime searchEndTime = DateUtils.getLastDayOfMonth(model.getSearchYear(), 12);
|
|
|
+ model.setSearchStartTime(searchStartTime);
|
|
|
+ model.setSearchEndTime(searchEndTime);
|
|
|
+ // 查询结果
|
|
|
+ List<RepairApplicationFormVO> list = mapper.selectRepairList(model);
|
|
|
+ Map<Integer,RepairApplicationFormVO> result = new HashMap<>();
|
|
|
+ for (Map<String, LocalDateTime> map : monthStartAndEndList) {
|
|
|
+ int currentMonth = map.get("searchStartTimeMonth").getMonthValue();
|
|
|
+ RepairApplicationFormVO vo = new RepairApplicationFormVO();
|
|
|
+ vo.setJiXiName("装备能源部-机械");
|
|
|
+ vo.setDianQiName("能源装备部-电气");
|
|
|
+ vo.setYiBiaoName("能源装备部-电气");
|
|
|
+ int jixieNum = 0;
|
|
|
+ int dianqiNum = 0;
|
|
|
+ int yibiaoNum = 0;
|
|
|
+ for (RepairApplicationFormVO repairApplicationForm : list) {
|
|
|
+ if (repairApplicationForm.getApplyTime().isAfter(map.get("searchStartTimeMonth")) && repairApplicationForm.getApplyTime().isBefore(map.get("searchEndTimeMonth"))) {
|
|
|
+ if(jiXi.equals(repairApplicationForm.getRepairDeptId())){
|
|
|
+ jixieNum++;
|
|
|
+ }else if(dianQi.equals(repairApplicationForm.getRepairDeptId())){
|
|
|
+ dianqiNum++;
|
|
|
+ }else if(yiBiao.equals(repairApplicationForm.getRepairDeptId())){
|
|
|
+ yibiaoNum++;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ vo.setJiXiNum(jixieNum);
|
|
|
+ vo.setDianQiNum(dianqiNum);
|
|
|
+ vo.setYiBiaoNum(yibiaoNum);
|
|
|
+ result.put(currentMonth,vo);
|
|
|
+ }
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+
|
|
|
@Override
|
|
|
public R getStoreForm(UserInfo userInfo) {
|
|
|
InStoreFormDTO inStoreFormDTO=new InStoreFormDTO();
|