diff --git a/src/main/java/com/zcloud/controller/assignedManage/AssignedManageController.java b/src/main/java/com/zcloud/controller/assignedManage/AssignedManageController.java index 336cff3..670ebec 100644 --- a/src/main/java/com/zcloud/controller/assignedManage/AssignedManageController.java +++ b/src/main/java/com/zcloud/controller/assignedManage/AssignedManageController.java @@ -51,7 +51,7 @@ public class AssignedManageController extends BaseController { pd.put("ASSIGNED_ID", this.get32UUID()); //车船税主键 pd.put("ISDELETE", "0"); //是否删除(0:有效 1:删除) pd.put("CREATOR", Jurisdiction.getUSER_ID()); //添加人id - pd.put("CREATORNAME", Jurisdiction.getUsername()); //添加人名字 + pd.put("CREATORNAME", Jurisdiction.getName()); //添加人名字 pd.put("CREATTIME", DateUtil.date2Str(new Date())); //添加时间 pd.put("ASSIGNED_DATE", pd.get("TRANSACTION_DATE")); pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); @@ -98,7 +98,7 @@ public class AssignedManageController extends BaseController { PageData pd = new PageData(); pd = this.getPageData(); pd.put("DELETOR", Jurisdiction.getUSER_ID()); - pd.put("DELETORNAME", Jurisdiction.getUsername()); + pd.put("DELETORNAME", Jurisdiction.getName()); pd.put("DELETTIME", DateUtil.date2Str(new Date())); pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); PageData assignedInfo = new PageData(); @@ -145,15 +145,14 @@ public class AssignedManageController extends BaseController { pd = this.getPageData(); pd.put("ISDELETE", "0"); //是否删除(0:有效 1:删除) pd.put("CREATOR", Jurisdiction.getUSER_ID()); //添加人id - pd.put("CREATORNAME", Jurisdiction.getUsername()); //添加人名字 + pd.put("CREATORNAME", Jurisdiction.getName()); //添加人名字 pd.put("CREATTIME", DateUtil.date2Str(new Date())); //添加时间 pd.put("OPERATOR", Jurisdiction.getUSER_ID()); //修改人id - pd.put("OPERATORNAME", Jurisdiction.getUsername()); // 修改人名字 + pd.put("OPERATORNAME", Jurisdiction.getName()); // 修改人名字 pd.put("OPERATTIME", DateUtil.date2Str(new Date())); // 修改时间 String expireDate = pd.getString("EXPIRE_DATE"); String day = DateUtil.getDay(); - boolean flag = DateUtil.compareDate(expireDate, day); - if (flag) { + if (DateUtil.compareDate(expireDate, day)) { pd.put("EXPIRE_STATUS", "expirestatus_01"); } else { pd.put("EXPIRE_STATUS", "expirestatus_02"); diff --git a/src/main/java/com/zcloud/controller/beidou/BeidouController.java b/src/main/java/com/zcloud/controller/beidou/BeidouController.java index 6b98bce..56f2c47 100644 --- a/src/main/java/com/zcloud/controller/beidou/BeidouController.java +++ b/src/main/java/com/zcloud/controller/beidou/BeidouController.java @@ -58,7 +58,7 @@ public class BeidouController extends BaseController { // @RequiresPermissions( value = {"question:add" , "courseware:add"}, logical = Logical.OR) @ResponseBody @LogAnno(menuType = "机务档案", menuServer = "北斗管理", instructionsOperate = "北斗管理", instructionsType = "新增") - public Object add(@RequestParam(value="FFILE",required=false) MultipartFile file) throws Exception { + public Object add(@RequestParam(value = "FFILE", required = false) MultipartFile file) throws Exception { Map map = new HashMap(); String errInfo = "success"; PageData pd = new PageData(); @@ -73,8 +73,8 @@ public class BeidouController extends BaseController { pd.put("ARCHIVES_TYPE", "0"); //档案状态 pd.put("VEHICLE", pd.get("PLATE_NUMBER")); //档案状态 String ffile = DateUtil.getDays(); - if (file != null && StringUtils.isNotBlank(pd.getString("CREATORNAME"))){ - String suffixName = file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf(".")+1).toLowerCase(); + if (file != null && StringUtils.isNotBlank(pd.getString("CREATORNAME"))) { + String suffixName = file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf(".") + 1).toLowerCase(); if (!"pdf".equals(suffixName) && !"jpg".equals(suffixName) && !"jpeg".equals(suffixName) && !"png".equals(suffixName)) { errInfo = "fail"; map.put("result", errInfo); @@ -84,22 +84,22 @@ public class BeidouController extends BaseController { String fileName = this.get32UUID() + file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf(".")); smb.sshSftp(file, fileName, Const.FILEPATHFILE + pd.getString("TRANSPORTATIONCOMPANY") + "/" + ffile); pd.put("CONTRACT", Const.FILEPATHFILE + pd.getString("TRANSPORTATIONCOMPANY") + "/" + ffile + "/" + fileName); - pd.put("ATTACHMENT_NAME",pd.getString("CREATORNAME")); - pd.put("CONFIRM_MESSAGE_TIME",DateUtil.date2Str(new Date())); + pd.put("ATTACHMENT_NAME", pd.getString("CREATORNAME")); + pd.put("CONFIRM_MESSAGE_TIME", DateUtil.date2Str(new Date())); } PageData operationData = new PageData(); operationData.put("OPERATING_ID", pd.get("VEHICLE")); operationData.put("CORPINFO_ID", pd.get("CORPINFO_ID")); PageData resData = operatingVehiclesService.findById(operationData); - if(!ObjectUtils.isEmpty(resData)) { - if(StringUtils.isNotBlank(pd.getString("DUE_DATE"))) { + if (!ObjectUtils.isEmpty(resData)) { + if (StringUtils.isNotBlank(pd.getString("DUE_DATE"))) { String expireDate = pd.getString("DUE_DATE"); String day = DateUtil.getDay(); - if(DateUtil.compareDate(expireDate, day)) { - resData.put("NETWORK_STATUS","已入网"); - }else{ - resData.put("NETWORK_STATUS","超时入网"); + if (DateUtil.compareDate(expireDate, day)) { + resData.put("NETWORK_STATUS", "已入网"); + } else { + resData.put("NETWORK_STATUS", "超时入网"); } } operatingVehiclesService.edit(resData); @@ -155,13 +155,13 @@ public class BeidouController extends BaseController { operationData.put("OPERATING_ID", pd.get("VEHICLE")); operationData.put("CORPINFO_ID", pd.get("CORPINFO_ID")); PageData resData = operatingVehiclesService.findById(operationData); - if(!ObjectUtils.isEmpty(resData)) { + if (!ObjectUtils.isEmpty(resData)) { String dueDate = pd.getString("DUE_DATE"); String day = DateUtil.getDay(); - if(DateUtil.compareDate(dueDate, day)) { - resData.put("NETWORK_STATUS","已入网"); - }else{ - resData.put("NETWORK_STATUS","超时入网"); + if (DateUtil.compareDate(dueDate, day)) { + resData.put("NETWORK_STATUS", "已入网"); + } else { + resData.put("NETWORK_STATUS", "超时入网"); } operatingVehiclesService.edit(resData); } @@ -213,14 +213,23 @@ public class BeidouController extends BaseController { pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); //企业ID page.setPd(pd); List varList = beidouService.list(page); //列出Question列表 - for (PageData operation : varList) { + + varList.stream().anyMatch(data -> { + if ("1".equals(data.getString("OPEAR_ISSCRAP")) || "1".equals(data.getString("FREIGHT_ISSCRAP"))) { + data.put("ARCHIVES_TYPE", "1"); + } else if ("1".equals(data.getString("OPEAR_ISASSIGNED")) || "1".equals(data.getString("FREIGHT_ISASSIGNED"))) { + data.put("ARCHIVES_TYPE", "2"); + } + return false; + }); + /*for (PageData operation : varList) { if("1".equals(operation.get("OPEAR_ISSCRAP")) || "1".equals(operation.get("FREIGHT_ISSCRAP"))) { operation.put("ARCHIVES_TYPE", "1"); } if("1".equals(operation.get("OPEAR_ISASSIGNED")) || "1".equals(operation.get("FREIGHT_ISASSIGNED"))) { operation.put("ARCHIVES_TYPE", "2"); } - } + }*/ map.put("varList", varList); map.put("page", page); map.put("result", errInfo); @@ -245,7 +254,7 @@ public class BeidouController extends BaseController { pd = beidouService.findById(pd); //根据ID读取 pd.put("FOREIGN_KEY", pd.getString("BEIDOU_ID")); - pd.put("TYPE",128); + pd.put("TYPE", 128); List beidouinfoImgs = imgfilesService.listAll(pd);//北斗资料图片 map.put("pd", pd); map.put("beidouinfoImgs", beidouinfoImgs); @@ -260,26 +269,26 @@ public class BeidouController extends BaseController { String errInfo = "success"; PageData pd = new PageData(); pd = this.getPageData(); - pd.put("CORPINFO_ID",Jurisdiction.getCORPINFO_ID()); - if(!StringUtils.isEmpty(pd.getString("TRAFFIC_TYPE")) && pd.getString("TRAFFIC_TYPE").equals("1")) { + pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); + if (!StringUtils.isEmpty(pd.getString("TRAFFIC_TYPE")) && pd.getString("TRAFFIC_TYPE").equals("1")) { // 营运车辆 List operatingList = operatingVehiclesService.operationVehicleList(pd.getString("CORPINFO_ID")); page.setPd(pd); List compassList = beidouService.list(page); List varList = new ArrayList<>(); - if(!CollectionUtils.isEmpty(compassList)) { + if (!CollectionUtils.isEmpty(compassList)) { varList = operatingList.stream().parallel() .filter(operating -> compassList.stream() .noneMatch(compass -> StringUtils.equals(operating.getString("OPERATING_ID"), compass.getString("VEHICLE")))) .collect(Collectors.toList()); - }else{ + } else { varList = operatingList; } - if(pd.containsKey("ID")){ + if (pd.containsKey("ID")) { pd.put("OPERATING_ID", pd.getString("ID")); pd.put("FOREIGN_KEY", pd.getString("OPERATING_ID")); - pd.put("TYPE",121); + pd.put("TYPE", 121); List drivingLicenseImgs = imgfilesService.listAll(pd);//行驶证照片 map.put("drivingLicenseImgs", drivingLicenseImgs); } @@ -290,37 +299,40 @@ public class BeidouController extends BaseController { map.put("result", errInfo); return map; } - if("2".equals(pd.getString("TRAFFIC_TYPE"))) { + if ("2".equals(pd.getString("TRAFFIC_TYPE"))) { // 货运挂车 List freightList = freightTrailerService.trailerList(pd.getString("CORPINFO_ID")); page.setPd(pd); List insAnnually = beidouService.list(page); - for (int i = 0; i < insAnnually.size(); i++) { - for (int j = 0; j < freightList.size(); j++) { - if(freightList.get(j).get("FREIGHTTRAILER_ID").equals(insAnnually.get(i).get("VEHICLE"))) { - freightList.remove(j); - } - } + + List varList = new ArrayList<>(); + if (!CollectionUtils.isEmpty(insAnnually)) { + varList = freightList.stream().parallel() + .filter(freight -> insAnnually.stream() + .noneMatch(ins -> StringUtils.equals(freight.getString("FREIGHTTRAILER_ID"), ins.getString("VEHICLE")))) + .collect(Collectors.toList()); + } else { + varList = freightList; } - if(pd.containsKey("ID")){ + if (pd.containsKey("ID")) { pd.put("FREIGHTTRAILER_ID", pd.getString("ID")); pd.put("FOREIGN_KEY", pd.getString("FREIGHTTRAILER_ID")); - pd.put("TYPE",121); + pd.put("TYPE", 121); List drivingLicenseImgs = imgfilesService.listAll(pd);//行驶证照片 map.put("drivingLicenseImgs", drivingLicenseImgs); } - freightList.forEach(freight -> { + varList.forEach(freight -> { freight.put("ID", freight.getString("FREIGHTTRAILER_ID")); }); - map.put("list", freightList); + map.put("list", varList); map.put("result", errInfo); return map; } List resData = freightTrailerService.vehicleList(pd); - if(pd.containsKey("ID")){ + if (pd.containsKey("ID")) { pd.put("FOREIGN_KEY", pd.getString("ID")); - pd.put("TYPE",121); + pd.put("TYPE", 121); List drivingLicenseImgs = imgfilesService.listAll(pd);//行驶证照片 map.put("drivingLicenseImgs", drivingLicenseImgs); } diff --git a/src/main/java/com/zcloud/controller/comprehensive/TrafficSafetyMeetingController.java b/src/main/java/com/zcloud/controller/comprehensive/TrafficSafetyMeetingController.java index 0e19964..b57f1a3 100644 --- a/src/main/java/com/zcloud/controller/comprehensive/TrafficSafetyMeetingController.java +++ b/src/main/java/com/zcloud/controller/comprehensive/TrafficSafetyMeetingController.java @@ -215,9 +215,9 @@ public class TrafficSafetyMeetingController extends BaseController { String PRACTITIONER = pd.getString("PRACTITIONER"); // 关键词检索条件 if (Tools.notEmpty(PRACTITIONER)) pd.put("PRACTITIONER", PRACTITIONER.trim()); - String PRACTITIONERTYPE = pd.getString("PRACTITIONERTYPE"); // 关键词检索条件 + String PRACTITIONERTYPE = pd.getString("PRACTITIONER_TYPE"); // 关键词检索条件 if (Tools.notEmpty(PRACTITIONERTYPE)) - pd.put("PRACTITIONERTYPE", PRACTITIONERTYPE.trim()); + pd.put("PRACTITIONER_TYPE", PRACTITIONERTYPE.trim()); String SIGNEDSTATUS = pd.getString("SIGNEDSTATUS"); // 关键词检索条件 if (Tools.notEmpty(SIGNEDSTATUS)) pd.put("SIGNEDSTATUS", SIGNEDSTATUS.trim()); diff --git a/src/main/java/com/zcloud/controller/comprehensive/TrafficSecurityCustomerManagementController.java b/src/main/java/com/zcloud/controller/comprehensive/TrafficSecurityCustomerManagementController.java index 314b776..104ef5a 100644 --- a/src/main/java/com/zcloud/controller/comprehensive/TrafficSecurityCustomerManagementController.java +++ b/src/main/java/com/zcloud/controller/comprehensive/TrafficSecurityCustomerManagementController.java @@ -26,6 +26,7 @@ import org.springframework.web.multipart.MultipartFile; import java.util.*; import java.util.stream.Collectors; +import java.util.stream.Stream; @Controller @RequestMapping("/securitycustomer") diff --git a/src/main/java/com/zcloud/controller/comprehensive/TrafficSecurityManagementAgreementController.java b/src/main/java/com/zcloud/controller/comprehensive/TrafficSecurityManagementAgreementController.java index 1a592cd..9920f59 100644 --- a/src/main/java/com/zcloud/controller/comprehensive/TrafficSecurityManagementAgreementController.java +++ b/src/main/java/com/zcloud/controller/comprehensive/TrafficSecurityManagementAgreementController.java @@ -17,6 +17,7 @@ import java.util.Date; import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.stream.Collectors; @Controller @RequestMapping("/managementagreement") @@ -29,7 +30,7 @@ public class TrafficSecurityManagementAgreementController extends BaseController //新增 @RequestMapping(value = "/add") @ResponseBody - public Object add(@RequestParam(value="FFILE",required=false) MultipartFile file) throws Exception { + public Object add(@RequestParam(value = "FFILE", required = false) MultipartFile file) throws Exception { Map map = new HashMap(); String errInfo = "success"; PageData pd = this.getPageData(); @@ -50,20 +51,20 @@ public class TrafficSecurityManagementAgreementController extends BaseController } String ffile = DateUtil.getDays(); - if (file != null && StringUtils.isNotBlank(pd.getString("CREATORNAME"))){ + if (file != null && StringUtils.isNotBlank(pd.getString("CREATORNAME"))) { pd.put("COMPLETIONSTATUS", "1"); - String suffixName = file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf(".")+1).toLowerCase(); + String suffixName = file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf(".") + 1).toLowerCase(); if (!"pdf".equals(suffixName) && !"jpg".equals(suffixName) && !"jpeg".equals(suffixName) && !"png".equals(suffixName)) { errInfo = "fail"; map.put("result", errInfo); map.put("msg", "文件格式不正确!"); return map; } - String fileName =file.getOriginalFilename(); + String fileName = file.getOriginalFilename(); smb.sshSftp(file, fileName, Const.FILEPATHFILE + pd.getString("CORPINFO_ID") + "/" + ffile); pd.put("ATTACHMENT_ROUTE", Const.FILEPATHFILE + pd.getString("CORPINFO_ID") + "/" + ffile + "/" + fileName); - pd.put("ATTACHMENT_NAME",pd.getString("CREATORNAME")); - pd.put("CONFIRM_MESSAGE_TIME",DateUtil.date2Str(new Date())); + pd.put("ATTACHMENT_NAME", pd.getString("CREATORNAME")); + pd.put("CONFIRM_MESSAGE_TIME", DateUtil.date2Str(new Date())); } managementAgreementService.save(pd); @@ -76,7 +77,7 @@ public class TrafficSecurityManagementAgreementController extends BaseController //修改 @RequestMapping(value = "/edit") @ResponseBody - public Object edit(@RequestParam(value="FFILE",required=false) MultipartFile file) throws Exception { + public Object edit(@RequestParam(value = "FFILE", required = false) MultipartFile file) throws Exception { Map map = new HashMap(); String errInfo = "success"; PageData pd = this.getPageData(); @@ -88,9 +89,9 @@ public class TrafficSecurityManagementAgreementController extends BaseController pd.put("ISDELETE", "0"); String ffile = DateUtil.getDays(); - if (file != null && StringUtils.isNotBlank(pd.getString("OPERATORNAME"))){ + if (file != null && StringUtils.isNotBlank(pd.getString("OPERATORNAME"))) { pd.put("COMPLETIONSTATUS", "1"); - String suffixName = file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf(".")+1).toLowerCase(); + String suffixName = file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf(".") + 1).toLowerCase(); if (!"pdf".equals(suffixName) && !"jpg".equals(suffixName) && !"jpeg".equals(suffixName) && !"png".equals(suffixName)) { errInfo = "fail"; map.put("result", errInfo); @@ -98,11 +99,11 @@ public class TrafficSecurityManagementAgreementController extends BaseController return map; } //String fileName = this.get32UUID() + file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf(".")); - String fileName =file.getOriginalFilename(); + String fileName = file.getOriginalFilename(); smb.sshSftp(file, fileName, Const.FILEPATHFILE + pd.getString("CORPINFO_ID") + "/" + ffile); pd.put("ATTACHMENT_ROUTE", Const.FILEPATHFILE + pd.getString("CORPINFO_ID") + "/" + ffile + "/" + fileName); - pd.put("ATTACHMENT_NAME",pd.getString("CREATORNAME")); - pd.put("CONFIRM_MESSAGE_TIME",DateUtil.date2Str(new Date())); + pd.put("ATTACHMENT_NAME", pd.getString("CREATORNAME")); + pd.put("CONFIRM_MESSAGE_TIME", DateUtil.date2Str(new Date())); } managementAgreementService.edit(pd); @@ -114,6 +115,7 @@ public class TrafficSecurityManagementAgreementController extends BaseController /** * 列表 + * * @param page * @return * @throws Exception @@ -129,15 +131,15 @@ public class TrafficSecurityManagementAgreementController extends BaseController page.setPd(pd); List varList = managementAgreementService.listForManagementAgreementlist(page); - varList.forEach(data -> { - if(DateUtil.getDay().equals(data.getString("EXPIRYDATE"))) { - data.put("VALIDSTATUS","1"); - } else if(DateUtil.compareDate( DateUtil.getDay(),data.getString("EXPIRYDATE")) ) { - data.put("VALIDSTATUS","0"); - } else if (DateUtil.compareDate( data.getString("EXPIRYDATE"),DateUtil.getDay()) || DateUtil.getDay().equals(data.getString("EXPIRYDATE"))) { - data.put("VALIDSTATUS","1"); + + /*varList.stream().anyMatch(data -> { + if (DateUtil.getDay().equals(data.getString("EXPIRYDATE")) || DateUtil.compareDate(data.getString("EXPIRYDATE"), DateUtil.getDay())) { + data.put("VALIDSTATUS", "1"); + } else { + data.put("VALIDSTATUS", "0"); } - }); + return false; + });*/ map.put("varList", varList); map.put("page", page); map.put("result", errInfo); @@ -145,14 +147,14 @@ public class TrafficSecurityManagementAgreementController extends BaseController } //详情 - @RequestMapping(value="/goEdit") + @RequestMapping(value = "/goEdit") @ResponseBody - public Object goEdit() throws Exception{ - Map map = new HashMap(); + public Object goEdit() throws Exception { + Map map = new HashMap(); String errInfo = "success"; PageData pd = new PageData(); pd = this.getPageData(); - pd = managementAgreementService.findById(pd); //根据ID读取 + pd = managementAgreementService.findById(pd); //根据ID读取 map.put("pd", pd); map.put("result", errInfo); return map; @@ -160,13 +162,14 @@ public class TrafficSecurityManagementAgreementController extends BaseController /** * 删除 + * * @return * @throws Exception */ - @RequestMapping(value="/delete") + @RequestMapping(value = "/delete") @ResponseBody - public Object delete() throws Exception{ - Map map = new HashMap(); + public Object delete() throws Exception { + Map map = new HashMap(); String errInfo = "success"; PageData pd = new PageData(); pd = this.getPageData(); diff --git a/src/main/java/com/zcloud/controller/comprehensive/TrafficSecurityViolationRegistrationController.java b/src/main/java/com/zcloud/controller/comprehensive/TrafficSecurityViolationRegistrationController.java index 1713cd6..36ffff7 100644 --- a/src/main/java/com/zcloud/controller/comprehensive/TrafficSecurityViolationRegistrationController.java +++ b/src/main/java/com/zcloud/controller/comprehensive/TrafficSecurityViolationRegistrationController.java @@ -25,14 +25,12 @@ public class TrafficSecurityViolationRegistrationController extends BaseControll @Autowired private TrafficSecurityViolationRegistrationService violationRegistrationService; - @Autowired - private UsersService usersService; @Autowired private Smb smb; @RequestMapping(value = "/add") @ResponseBody - public Object add(@RequestParam(value="FFILE",required=false) MultipartFile file) throws Exception { + public Object add(@RequestParam(value = "FFILE", required = false) MultipartFile file) throws Exception { Map map = new HashMap(); String errInfo = "success"; PageData pd = this.getPageData(); @@ -47,19 +45,19 @@ public class TrafficSecurityViolationRegistrationController extends BaseControll pd.put("ISDELETE", "0"); String ffile = DateUtil.getDays(); - if (file != null && StringUtils.isNotBlank(pd.getString("CREATORNAME"))){ - String suffixName = file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf(".")+1).toLowerCase(); + if (file != null && StringUtils.isNotBlank(pd.getString("CREATORNAME"))) { + String suffixName = file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf(".") + 1).toLowerCase(); if (!"pdf".equals(suffixName) && !"jpg".equals(suffixName) && !"jpeg".equals(suffixName) && !"png".equals(suffixName)) { errInfo = "fail"; map.put("result", errInfo); map.put("msg", "文件格式不正确!"); return map; } - String fileName = this.get32UUID() + file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf(".")); + String fileName = file.getOriginalFilename(); smb.sshSftp(file, fileName, Const.FILEPATHFILE + pd.getString("CORPINFO_ID") + "/" + ffile); pd.put("ATTACHMENT_ROUTE", Const.FILEPATHFILE + pd.getString("CORPINFO_ID") + "/" + ffile + "/" + fileName); - pd.put("ATTACHMENT_NAME",pd.getString("CREATORNAME")); - pd.put("CONFIRM_MESSAGE_TIME",DateUtil.date2Str(new Date())); + pd.put("ATTACHMENT_NAME", pd.getString("CREATORNAME")); + pd.put("CONFIRM_MESSAGE_TIME", DateUtil.date2Str(new Date())); } violationRegistrationService.save(pd); @@ -86,14 +84,16 @@ public class TrafficSecurityViolationRegistrationController extends BaseControll return map; } - /**删除 + /** + * 删除 + * * @param * @throws Exception */ - @RequestMapping(value="/delete") + @RequestMapping(value = "/delete") @ResponseBody - public Object delete() throws Exception{ - Map map = new HashMap(); + public Object delete() throws Exception { + Map map = new HashMap(); String errInfo = "success"; PageData pd = new PageData(); pd = this.getPageData(); @@ -107,10 +107,11 @@ public class TrafficSecurityViolationRegistrationController extends BaseControll /** * 查看详情 + * * @return * @throws Exception */ - @RequestMapping(value="/goEdit") + @RequestMapping(value = "/goEdit") @ResponseBody public Object goEdit() throws Exception { Map map = new HashMap<>(); @@ -125,7 +126,7 @@ public class TrafficSecurityViolationRegistrationController extends BaseControll //修改 @RequestMapping(value = "/edit") @ResponseBody - public Object edit(@RequestParam(value="FFILE",required=false) MultipartFile file) throws Exception { + public Object edit(@RequestParam(value = "FFILE", required = false) MultipartFile file) throws Exception { Map map = new HashMap(); String errInfo = "success"; PageData pd = this.getPageData(); @@ -135,20 +136,20 @@ public class TrafficSecurityViolationRegistrationController extends BaseControll pd.put("OPERATTIME", DateUtil.date2Str(new Date())); // 修改时间 String ffile = DateUtil.getDays(); - if (file != null && StringUtils.isNotBlank(pd.getString("OPERATORNAME"))){ + if (file != null && StringUtils.isNotBlank(pd.getString("OPERATORNAME"))) { pd.put("COMPLETIONSTATUS", "1"); - String suffixName = file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf(".")+1).toLowerCase(); + String suffixName = file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf(".") + 1).toLowerCase(); if (!"pdf".equals(suffixName) && !"jpg".equals(suffixName) && !"jpeg".equals(suffixName) && !"png".equals(suffixName)) { errInfo = "fail"; map.put("result", errInfo); map.put("msg", "文件格式不正确!"); return map; } - String fileName = this.get32UUID() + file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf(".")); + String fileName = file.getOriginalFilename(); smb.sshSftp(file, fileName, Const.FILEPATHFILE + pd.getString("OPERATINGCOMPANY") + "/" + ffile); pd.put("ATTACHMENT_ROUTE", Const.FILEPATHFILE + pd.getString("OPERATINGCOMPANY") + "/" + ffile + "/" + fileName); - pd.put("ATTACHMENT_NAME",pd.getString("CREATORNAME")); - pd.put("CONFIRM_MESSAGE_TIME",DateUtil.date2Str(new Date())); + pd.put("ATTACHMENT_NAME", pd.getString("CREATORNAME")); + pd.put("CONFIRM_MESSAGE_TIME", DateUtil.date2Str(new Date())); } violationRegistrationService.edit(pd); diff --git a/src/main/java/com/zcloud/controller/comprehensive/TrafficSecurityWaybillRegistrationController.java b/src/main/java/com/zcloud/controller/comprehensive/TrafficSecurityWaybillRegistrationController.java index fbcda9d..6eeb98b 100644 --- a/src/main/java/com/zcloud/controller/comprehensive/TrafficSecurityWaybillRegistrationController.java +++ b/src/main/java/com/zcloud/controller/comprehensive/TrafficSecurityWaybillRegistrationController.java @@ -59,10 +59,11 @@ public class TrafficSecurityWaybillRegistrationController extends BaseController /** * 查看详情 + * * @return * @throws Exception */ - @RequestMapping(value="/getDetail") + @RequestMapping(value = "/getDetail") @ResponseBody public Object goEdit() throws Exception { Map map = new HashMap<>(); @@ -70,7 +71,7 @@ public class TrafficSecurityWaybillRegistrationController extends BaseController PageData pd = this.getPageData(); List commitmentList = trafficDrivingCommitmentService.getDrivingCommitment(pd); try { - pd = trafficDrivingTypeService.infoCategory(pd); //根据ID读取 + pd = trafficDrivingTypeService.infoCategory(pd); //根据ID读取 // if(pd.getString("OPERATOR")) // pd.put("a", "119.60436762"); // pd.put("b", "39.94546157"); @@ -122,47 +123,52 @@ public class TrafficSecurityWaybillRegistrationController extends BaseController /** * 删除 + * * @return * @throws Exception */ - @RequestMapping(value="/delete") + @RequestMapping(value = "/delete") @ResponseBody - public Object delete() throws Exception{ - Map map = new HashMap(); + public Object delete() throws Exception { + Map map = new HashMap(); String errInfo = "success"; PageData pd = new PageData(); pd = this.getPageData(); pd.put("DELETOR", Jurisdiction.getUSER_ID());//删除人id pd.put("DELETORNAME", Jurisdiction.getName());//删除人姓名 pd.put("DELETETIME", DateUtil.date2Str(new Date()));//删除时间 + pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); trafficSecurityWaybillRegistrationService.delete(pd); map.put("result", errInfo); return map; } - /**批量删除 + /** + * 批量删除 + * * @param * @throws Exception */ - @RequestMapping(value="/deleteAll") + @RequestMapping(value = "/deleteAll") @ResponseBody - public Object deleteAll() throws Exception{ - Map map = new HashMap(); + public Object deleteAll() throws Exception { + Map map = new HashMap(); String errInfo = "success"; - String err=""; + String err = ""; PageData pd = new PageData(); pd = this.getPageData(); String DATA_IDS = pd.getString("DATA_IDS"); - if(Tools.notEmpty(DATA_IDS)){ + if (Tools.notEmpty(DATA_IDS)) { String ArrayDATA_IDS[] = DATA_IDS.split(","); for (String id : ArrayDATA_IDS) { pd.put("WAYBILLREGISTRATION_ID", id); pd.put("DELETORNAME", Jurisdiction.getName());//删除人 pd.put("DELETETIME", DateUtil.date2Str(new Date()));//删除时间 + pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); trafficSecurityWaybillRegistrationService.delete(pd); } errInfo = "success"; - }else{ + } else { errInfo = "error"; } map.put("result", errInfo);//返回结果 @@ -171,45 +177,43 @@ public class TrafficSecurityWaybillRegistrationController extends BaseController //详情 - @RequestMapping(value="/goEdit") + @RequestMapping(value = "/goEdit") @ResponseBody - public Object getSecurityWaybillRegistrationInfo() throws Exception{ - Map map = new HashMap(); + public Object getSecurityWaybillRegistrationInfo() throws Exception { + Map map = new HashMap(); String errInfo = "success"; PageData pd = new PageData(); pd = this.getPageData(); + pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); pd = trafficSecurityWaybillRegistrationService.findById(pd);//根据ID读 - if("".equals(pd.getString("TRUCKCART")) || "undefined".equals(pd.getString("TRUCKCART")) || StringUtils.isEmpty(pd.getString("TRUCKCART"))) { - pd.put("TRUCKCART",""); - } + String[] dispatchers = pd.getString("DISPATCHER").split(","); List names = new ArrayList<>(); for (String dispatcher : dispatchers) { - // 通过 用户id获取用户名 PageData user = new PageData(); - user.put("USER_ID",dispatcher.trim()); + user.put("USER_ID", dispatcher.trim()); PageData pageData1 = usersService.findById(user); names.add(pageData1); } List deptList = usersService.listUserbyDep(pd); - pd.put("deptList",deptList); - pd.put("names",names); + pd.put("deptList", deptList); + pd.put("names", names); map.put("pd", pd); map.put("result", errInfo); return map; } - @RequestMapping(value="/getPrincipalContactList") + @RequestMapping(value = "/getPrincipalContactList") @ResponseBody - public Object getPrincipalContactList() throws Exception{ - Map map = new HashMap(); + public Object getPrincipalContactList() throws Exception { + Map map = new HashMap(); String errInfo = "success"; PageData pd = new PageData(); pd = this.getPageData(); pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); List principalContactList = trafficSecurityCustomerManagementService.getPrincipalContactList(pd); - map.put("pd",principalContactList); + map.put("pd", principalContactList); map.put("result", errInfo); return map; } @@ -230,12 +234,12 @@ public class TrafficSecurityWaybillRegistrationController extends BaseController PageData pd2 = new PageData(); pd2.put("CONTACT", pd.getString("ENTRUST_PERSON")); PageData contactInfo = trafficSecurityCustomerManagementService.findByContactName(pd2); - if(!ObjectUtil.isEmpty(contactInfo)) { + if (!ObjectUtil.isEmpty(contactInfo)) { pd.put("ENTRUST_PERSON", contactInfo.getString("CONTACT_ID")); - if(!contactInfo.getString("CONTACTPHONE").equals(pd.getString("CLIENTCONTACTPHONE"))) { + if (!contactInfo.getString("CONTACTPHONE").equals(pd.getString("CLIENTCONTACTPHONE"))) { PageData entrust = new PageData(); entrust.put("CONTACTPHONE", pd.getString("CLIENTCONTACTPHONE")); - entrust.put("CUSTOMERCONTACT_ID",contactInfo.getString("CUSTOMERCONTACT_ID")); + entrust.put("CUSTOMERCONTACT_ID", contactInfo.getString("CUSTOMERCONTACT_ID")); entrust.put("OPERATOR", Jurisdiction.getUSER_ID()); // 修改人id entrust.put("OPERATORNAME", Jurisdiction.getName()); // 修改人姓名 entrust.put("OPERATTIME", DateUtil.date2Str(new Date())); // 修改时间 @@ -245,12 +249,12 @@ public class TrafficSecurityWaybillRegistrationController extends BaseController PageData pd3 = new PageData(); pd3.put("CONTACT", pd.getString("CONFIRM_PERSON")); PageData pageData = trafficSecurityCustomerManagementService.findByContactName(pd3); - if(!ObjectUtil.isEmpty(pageData)) { + if (!ObjectUtil.isEmpty(pageData)) { pd.put("CONFIRM_PERSON", pageData.getString("CONTACT_ID")); - if(!pd.getString("CONFIRMINGPHONE").equals(pageData.getString("CONTACTPHONE"))) { + if (!pd.getString("CONFIRMINGPHONE").equals(pageData.getString("CONTACTPHONE"))) { PageData entrust = new PageData(); entrust.put("CONTACTPHONE", pd.getString("CONFIRMINGPHONE")); - entrust.put("CUSTOMERCONTACT_ID",pageData.getString("CUSTOMERCONTACT_ID")); + entrust.put("CUSTOMERCONTACT_ID", pageData.getString("CUSTOMERCONTACT_ID")); entrust.put("OPERATOR", Jurisdiction.getUSER_ID()); // 修改人id entrust.put("OPERATORNAME", Jurisdiction.getName()); // 修改人姓名 entrust.put("OPERATTIME", DateUtil.date2Str(new Date())); // 修改时间 diff --git a/src/main/java/com/zcloud/controller/enterpriseSafetyProduction/EnterpriseSafetyProductionController.java b/src/main/java/com/zcloud/controller/enterpriseSafetyProduction/EnterpriseSafetyProductionController.java index be72cf3..680e1ec 100644 --- a/src/main/java/com/zcloud/controller/enterpriseSafetyProduction/EnterpriseSafetyProductionController.java +++ b/src/main/java/com/zcloud/controller/enterpriseSafetyProduction/EnterpriseSafetyProductionController.java @@ -4,12 +4,8 @@ import com.zcloud.controller.base.BaseController; import com.zcloud.entity.Page; import com.zcloud.entity.PageData; import com.zcloud.service.enterpriseSafetyProduction.EnterpriseSafetyProductionService; -import com.zcloud.service.freighttrailer.FreightTrailerService; -import com.zcloud.service.operatingvehicles.OperatingVehiclesService; -import com.zcloud.service.scrapManage.ScrapManageService; import com.zcloud.util.DateUtil; import com.zcloud.util.Jurisdiction; -import com.zcloud.util.Smb; import com.zcloud.util.Tools; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; @@ -28,40 +24,41 @@ public class EnterpriseSafetyProductionController extends BaseController { @Autowired private EnterpriseSafetyProductionService enterpriseSafetyProductionService; - @Autowired - private Smb smb; - - /**新增 + /** + * 新增 + * * @param * @throws Exception */ - @RequestMapping(value="/add") + @RequestMapping(value = "/add") @ResponseBody - public Object add() throws Exception{ - Map map = new HashMap(); + public Object add() throws Exception { + Map map = new HashMap(); String errInfo = "success"; PageData pd = new PageData(); pd = this.getPageData(); pd.put("SAFETYPRODUCTION_ID", this.get32UUID()); pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); - pd.put("ISDELETE", "0"); //是否删除(0:有效 1:删除) - pd.put("CREATOR", Jurisdiction.getUSER_ID()); //添加人id - pd.put("CREATORNAME", Jurisdiction.getName()); //添加人名字 - pd.put("CREATTIME", DateUtil.date2Str(new Date())); //添加时间 + pd.put("ISDELETE", "0"); //是否删除(0:有效 1:删除) + pd.put("CREATOR", Jurisdiction.getUSER_ID()); //添加人id + pd.put("CREATORNAME", Jurisdiction.getName()); //添加人名字 + pd.put("CREATTIME", DateUtil.date2Str(new Date())); //添加时间 enterpriseSafetyProductionService.save(pd); map.put("pd", pd); map.put("result", errInfo); return map; } - /**删除 + /** + * 删除 + * * @param * @throws Exception */ - @RequestMapping(value="/delete") + @RequestMapping(value = "/delete") @ResponseBody - public Object delete() throws Exception{ - Map map = new HashMap(); + public Object delete() throws Exception { + Map map = new HashMap(); String errInfo = "success"; PageData pd = new PageData(); pd = this.getPageData(); @@ -70,23 +67,25 @@ public class EnterpriseSafetyProductionController extends BaseController { pd.put("DELETTIME", DateUtil.date2Str(new Date())); pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); enterpriseSafetyProductionService.delete(pd); - map.put("result", errInfo); //返回结果 + map.put("result", errInfo); //返回结果 return map; } - /**修改 + /** + * 修改 + * * @param * @throws Exception */ - @RequestMapping(value="/edit") + @RequestMapping(value = "/edit") @ResponseBody - public Object edit() throws Exception{ - Map map = new HashMap(); + public Object edit() throws Exception { + Map map = new HashMap(); String errInfo = "success"; PageData pd = new PageData(); pd = this.getPageData(); - pd.put("ISDELETE", "0"); //是否删除(0:有效 1:删除) - pd.put("OPERATOR", Jurisdiction.getUSER_ID()); //修改人id + pd.put("ISDELETE", "0"); //是否删除(0:有效 1:删除) + pd.put("OPERATOR", Jurisdiction.getUSER_ID()); //修改人id pd.put("OPERATORNAME", Jurisdiction.getName()); // 修改人名字 pd.put("OPERATTIME", DateUtil.date2Str(new Date())); // 修改时间 enterpriseSafetyProductionService.edit(pd); @@ -94,14 +93,17 @@ public class EnterpriseSafetyProductionController extends BaseController { map.put("result", errInfo); return map; } - /**去修改页面获取数据 + + /** + * 去修改页面获取数据 + * * @param * @throws Exception */ - @RequestMapping(value="/goEdit") + @RequestMapping(value = "/goEdit") @ResponseBody - public Object goEdit() throws Exception{ - Map map = new HashMap(); + public Object goEdit() throws Exception { + Map map = new HashMap(); String errInfo = "success"; PageData pd = new PageData(); pd = this.getPageData(); @@ -112,18 +114,18 @@ public class EnterpriseSafetyProductionController extends BaseController { return map; } - @RequestMapping(value="/list") + @RequestMapping(value = "/list") @ResponseBody - public Object list(Page page) throws Exception{ - Map map = new HashMap(); + public Object list(Page page) throws Exception { + Map map = new HashMap(); String errInfo = "success"; PageData pd = new PageData(); pd = this.getPageData(); - String KEYWORDS = pd.getString("KEYWORDS"); //关键词检索条件 - if(Tools.notEmpty(KEYWORDS))pd.put("KEYWORDS", KEYWORDS.trim()); + String KEYWORDS = pd.getString("KEYWORDS"); //关键词检索条件 + if (Tools.notEmpty(KEYWORDS)) pd.put("KEYWORDS", KEYWORDS.trim()); pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); page.setPd(pd); - List varList = enterpriseSafetyProductionService.list(page); //列出MajorDangerSource列表 + List varList = enterpriseSafetyProductionService.list(page); //列出MajorDangerSource列表 map.put("varList", varList); map.put("page", page); map.put("result", errInfo); diff --git a/src/main/java/com/zcloud/controller/firefightingEquipmentFacility/FirefightingEquipmentFacilityController.java b/src/main/java/com/zcloud/controller/firefightingEquipmentFacility/FirefightingEquipmentFacilityController.java index 2a03f69..b1ef3ad 100644 --- a/src/main/java/com/zcloud/controller/firefightingEquipmentFacility/FirefightingEquipmentFacilityController.java +++ b/src/main/java/com/zcloud/controller/firefightingEquipmentFacility/FirefightingEquipmentFacilityController.java @@ -27,43 +27,44 @@ public class FirefightingEquipmentFacilityController extends BaseController { @Autowired private FirefightingEquipmentFacilityService firefightingEquipmentFacilityService; - @Autowired - private Smb smb; - @Autowired private ImgFilesService imgfilesService; - /**新增 + /** + * 新增 + * * @param * @throws Exception */ - @RequestMapping(value="/add") + @RequestMapping(value = "/add") @ResponseBody - public Object add() throws Exception{ - Map map = new HashMap(); + public Object add() throws Exception { + Map map = new HashMap(); String errInfo = "success"; PageData pd = new PageData(); pd = this.getPageData(); pd.put("FIREFIGHTINGFACILITY_ID", this.get32UUID()); pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); - pd.put("ISDELETE", "0"); //是否删除(0:有效 1:删除) - pd.put("CREATOR", Jurisdiction.getUSER_ID()); //添加人id - pd.put("CREATORNAME", Jurisdiction.getName()); //添加人名字 - pd.put("CREATTIME", DateUtil.date2Str(new Date())); //添加时间 + pd.put("ISDELETE", "0"); //是否删除(0:有效 1:删除) + pd.put("CREATOR", Jurisdiction.getUSER_ID()); //添加人id + pd.put("CREATORNAME", Jurisdiction.getName()); //添加人名字 + pd.put("CREATTIME", DateUtil.date2Str(new Date())); //添加时间 firefightingEquipmentFacilityService.save(pd); map.put("pd", pd); map.put("result", errInfo); return map; } - /**删除 + /** + * 删除 + * * @param * @throws Exception */ - @RequestMapping(value="/delete") + @RequestMapping(value = "/delete") @ResponseBody - public Object delete() throws Exception{ - Map map = new HashMap(); + public Object delete() throws Exception { + Map map = new HashMap(); String errInfo = "success"; PageData pd = new PageData(); pd = this.getPageData(); @@ -72,23 +73,25 @@ public class FirefightingEquipmentFacilityController extends BaseController { pd.put("DELETTIME", DateUtil.date2Str(new Date())); pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); firefightingEquipmentFacilityService.delete(pd); - map.put("result", errInfo); //返回结果 + map.put("result", errInfo); //返回结果 return map; } - /**修改 + /** + * 修改 + * * @param * @throws Exception */ - @RequestMapping(value="/edit") + @RequestMapping(value = "/edit") @ResponseBody - public Object edit() throws Exception{ - Map map = new HashMap(); + public Object edit() throws Exception { + Map map = new HashMap(); String errInfo = "success"; PageData pd = new PageData(); pd = this.getPageData(); - pd.put("ISDELETE", "0"); //是否删除(0:有效 1:删除) - pd.put("OPERATOR", Jurisdiction.getUSER_ID()); //修改人id + pd.put("ISDELETE", "0"); //是否删除(0:有效 1:删除) + pd.put("OPERATOR", Jurisdiction.getUSER_ID()); //修改人id pd.put("OPERATORNAME", Jurisdiction.getName()); // 修改人名字 pd.put("OPERATTIME", DateUtil.date2Str(new Date())); // 修改时间 firefightingEquipmentFacilityService.edit(pd); @@ -96,21 +99,24 @@ public class FirefightingEquipmentFacilityController extends BaseController { map.put("result", errInfo); return map; } - /**去修改页面获取数据 + + /** + * 去修改页面获取数据 + * * @param * @throws Exception */ - @RequestMapping(value="/goEdit") + @RequestMapping(value = "/goEdit") @ResponseBody - public Object goEdit() throws Exception{ - Map map = new HashMap(); + public Object goEdit() throws Exception { + Map map = new HashMap(); String errInfo = "success"; PageData pd = new PageData(); pd = this.getPageData(); pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); pd = firefightingEquipmentFacilityService.findById(pd); pd.put("FOREIGN_KEY", pd.getString("FIREFIGHTINGFACILITY_ID")); - pd.put("TYPE",120); + pd.put("TYPE", 120); List firefightingequipmentImg = imgfilesService.listAll(pd); //设备设施 map.put("firefightingequipmentImg", firefightingequipmentImg); map.put("pd", pd); @@ -118,18 +124,18 @@ public class FirefightingEquipmentFacilityController extends BaseController { return map; } - @RequestMapping(value="/list") + @RequestMapping(value = "/list") @ResponseBody - public Object list(Page page) throws Exception{ - Map map = new HashMap(); + public Object list(Page page) throws Exception { + Map map = new HashMap(); String errInfo = "success"; PageData pd = new PageData(); pd = this.getPageData(); - String KEYWORDS = pd.getString("KEYWORDS"); //关键词检索条件 - if(Tools.notEmpty(KEYWORDS))pd.put("KEYWORDS", KEYWORDS.trim()); + String KEYWORDS = pd.getString("KEYWORDS"); //关键词检索条件 + if (Tools.notEmpty(KEYWORDS)) pd.put("KEYWORDS", KEYWORDS.trim()); pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); page.setPd(pd); - List varList = firefightingEquipmentFacilityService.list(page); //列出MajorDangerSource列表 + List varList = firefightingEquipmentFacilityService.list(page); //列出MajorDangerSource列表 map.put("varList", varList); map.put("page", page); map.put("result", errInfo); diff --git a/src/main/java/com/zcloud/controller/inspectAnnually/InspectAnnuallyController.java b/src/main/java/com/zcloud/controller/inspectAnnually/InspectAnnuallyController.java index 9408bb3..03d9fe3 100644 --- a/src/main/java/com/zcloud/controller/inspectAnnually/InspectAnnuallyController.java +++ b/src/main/java/com/zcloud/controller/inspectAnnually/InspectAnnuallyController.java @@ -160,15 +160,16 @@ public class InspectAnnuallyController extends BaseController { pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); //企业ID page.setPd(pd); List varList = inspectAnnuallyService.list(page); //列出年检列表 - varList.forEach(inspectAnnually -> { - boolean isScrapFlag = varList.stream().anyMatch(data -> "1".equals(inspectAnnually.get("OPEAR_ISSCRAP")) || "1".equals(inspectAnnually.get("FREIGHT_ISSCRAP"))); - boolean isAssignedFlag = varList.stream().anyMatch(data -> "1".equals(inspectAnnually.get("OPEAR_ISASSIGNED")) || "1".equals(inspectAnnually.get("FREIGHT_ISASSIGNED"))); - if (isScrapFlag) { - inspectAnnually.put("ARCHIVES_TYPE", "2"); - } else if (isAssignedFlag) { - inspectAnnually.put("ARCHIVES_TYPE", "1"); + + varList.stream().anyMatch(data -> { + if("1".equals(data.getString("OPEAR_ISSCRAP")) || "1".equals(data.getString("FREIGHT_ISSCRAP"))) { + data.put("ARCHIVES_TYPE", "2"); + } else if ("1".equals(data.getString("OPEAR_ISASSIGNED")) || "1".equals(data.getString("FREIGHT_ISASSIGNED"))) { + data.put("ARCHIVES_TYPE", "1"); } + return false; }); + map.put("varList", varList); map.put("page", page); map.put("result", errInfo); diff --git a/src/main/java/com/zcloud/controller/maintain/MaintainController.java b/src/main/java/com/zcloud/controller/maintain/MaintainController.java index 4202709..0a5569e 100644 --- a/src/main/java/com/zcloud/controller/maintain/MaintainController.java +++ b/src/main/java/com/zcloud/controller/maintain/MaintainController.java @@ -50,9 +50,6 @@ public class MaintainController extends BaseController { pd.put("CREATOR", Jurisdiction.getUSER_ID()); //添加人id pd.put("CREATORNAME", Jurisdiction.getUsername()); //添加人名字 pd.put("CREATTIME", DateUtil.date2Str(new Date())); //添加时间 - pd.put("OPERATOR", Jurisdiction.getUSER_ID()); //修改人id - pd.put("OPERATORNAME", Jurisdiction.getUsername()); // 修改人名字 - pd.put("OPERATTIME", DateUtil.date2Str(new Date())); // 修改时间 maintainService.save(pd); map.put("pd", pd); map.put("result", errInfo); @@ -71,7 +68,7 @@ public class MaintainController extends BaseController { PageData pd = new PageData(); pd = this.getPageData(); pd.put("DELETOR", Jurisdiction.getUSER_ID()); - pd.put("DELETORNAME", Jurisdiction.getUsername()); + pd.put("DELETORNAME", Jurisdiction.getName()); pd.put("DELETTIME", DateUtil.date2Str(new Date())); maintainService.delete(pd); map.put("result", errInfo); //返回结果 @@ -90,11 +87,8 @@ public class MaintainController extends BaseController { PageData pd = new PageData(); pd = this.getPageData(); pd.put("ISDELETE", "0"); //是否删除(0:有效 1:删除) - pd.put("CREATOR", Jurisdiction.getUSER_ID()); //添加人id - pd.put("CREATORNAME", Jurisdiction.getUsername()); //添加人名字 - pd.put("CREATTIME", DateUtil.date2Str(new Date())); //添加时间 pd.put("OPERATOR", Jurisdiction.getUSER_ID()); //修改人id - pd.put("OPERATORNAME", Jurisdiction.getUsername()); // 修改人名字 + pd.put("OPERATORNAME", Jurisdiction.getName()); // 修改人名字 pd.put("OPERATTIME", DateUtil.date2Str(new Date())); // 修改时间 maintainService.edit(pd); map.put("pd", pd); diff --git a/src/main/java/com/zcloud/controller/maintenance/MaintenanceController.java b/src/main/java/com/zcloud/controller/maintenance/MaintenanceController.java index a16d60a..2305b6e 100644 --- a/src/main/java/com/zcloud/controller/maintenance/MaintenanceController.java +++ b/src/main/java/com/zcloud/controller/maintenance/MaintenanceController.java @@ -156,15 +156,18 @@ public class MaintenanceController extends BaseController { pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); //企业ID page.setPd(pd); List varList = maintenanceService.list(page); //列出Question列表 - for (PageData operation : varList) { - if ("1".equals(operation.get("OPEAR_ISSCRAP")) || "1".equals(operation.get("FREIGHT_ISSCRAP"))) { - operation.put("ARCHIVES_TYPE", "2"); - } else if ("1".equals(operation.get("OPEAR_ISASSIGNED")) || "1".equals(operation.get("FREIGHT_ISASSIGNED"))) { - operation.put("ARCHIVES_TYPE", "1"); + + varList.stream().anyMatch(data -> { + if ("1".equals(data.getString("OPEAR_ISSCRAP")) || "1".equals(data.getString("FREIGHT_ISSCRAP"))) { + data.put("ARCHIVES_TYPE", "2"); + } else if ("1".equals(data.getString("OPEAR_ISASSIGNED")) || "1".equals(data.getString("FREIGHT_ISASSIGNED"))) { + data.put("ARCHIVES_TYPE", "1"); } else { - operation.put("ARCHIVES_TYPE", "0"); + data.put("ARCHIVES_TYPE", "0"); } - } + return false; + }); + map.put("varList", varList); map.put("page", page); map.put("result", errInfo); @@ -234,37 +237,41 @@ public class MaintenanceController extends BaseController { map.put("result", errInfo); return map; } - if("2".equals(pd.getString("TRAFFIC_TYPE"))) { + if ("2".equals(pd.getString("TRAFFIC_TYPE"))) { // 货运挂车 List freightList = freightTrailerService.trailerList(pd.getString("CORPINFO_ID")); page.setPd(pd); - List insAnnually = maintenanceService.list(page); - for (int i = 0; i < insAnnually.size(); i++) { - for (int j = 0; j < freightList.size(); j++) { - if(freightList.get(j).get("FREIGHTTRAILER_ID").equals(insAnnually.get(i).get("VEHICLE"))) { - freightList.remove(j); - } - } + List maintenanceList = maintenanceService.list(page); + + List varList = new ArrayList<>(); + if (!CollectionUtils.isEmpty(maintenanceList)) { + varList = freightList.stream().parallel() + .filter(freight -> freightList.stream() + .noneMatch(maintenance -> StringUtils.equals(freight.getString("FREIGHTTRAILER_ID"), maintenance.getString("VEHICLE")))) + .collect(Collectors.toList()); + } else { + varList = freightList; } - if(pd.containsKey("ID")){ + + if (pd.containsKey("ID")) { pd.put("FREIGHTTRAILER_ID", pd.getString("ID")); pd.put("FOREIGN_KEY", pd.getString("FREIGHTTRAILER_ID")); - pd.put("TYPE",121); + pd.put("TYPE", 121); List drivingLicenseImgs = imgfilesService.listAll(pd);//行驶证照片 map.put("drivingLicenseImgs", drivingLicenseImgs); } - freightList.forEach(freight -> { + varList.forEach(freight -> { freight.put("ID", freight.getString("FREIGHTTRAILER_ID")); }); - map.put("list", freightList); + map.put("list", varList); map.put("result", errInfo); return map; } List resData = freightTrailerService.vehicleList(pd); - if(pd.containsKey("ID")){ + if (pd.containsKey("ID")) { pd.put("FOREIGN_KEY", pd.getString("ID")); - pd.put("TYPE",121); + pd.put("TYPE", 121); List drivingLicenseImgs = imgfilesService.listAll(pd);//行驶证照片 map.put("drivingLicenseImgs", drivingLicenseImgs); } diff --git a/src/main/java/com/zcloud/controller/operations/OperationsController.java b/src/main/java/com/zcloud/controller/operations/OperationsController.java index a2a429c..e3ad339 100644 --- a/src/main/java/com/zcloud/controller/operations/OperationsController.java +++ b/src/main/java/com/zcloud/controller/operations/OperationsController.java @@ -156,14 +156,16 @@ public class OperationsController extends BaseController { pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); //企业ID page.setPd(pd); List varList = operationsService.list(page); //列出Question列表 - for (PageData operation : varList) { - if("1".equals(operation.get("OPEAR_ISSCRAP")) || "1".equals(operation.get("FREIGHT_ISSCRAP"))) { - operation.put("ARCHIVES_TYPE", "2"); + + varList.stream().anyMatch(data -> { + if("1".equals(data.getString("OPEAR_ISSCRAP")) || "1".equals(data.getString("FREIGHT_ISSCRAP"))) { + data.put("ARCHIVES_TYPE", "2"); + } else if ("1".equals(data.getString("OPEAR_ISASSIGNED")) || "1".equals(data.getString("FREIGHT_ISASSIGNED"))) { + data.put("ARCHIVES_TYPE", "1"); } - if("1".equals(operation.get("OPEAR_ISASSIGNED")) || "1".equals(operation.get("FREIGHT_ISASSIGNED"))) { - operation.put("ARCHIVES_TYPE", "1"); - } - } + return false; + }); + map.put("varList", varList); map.put("page", page); map.put("result", errInfo); diff --git a/src/main/java/com/zcloud/controller/reportedIncident/ReportedIncidentController.java b/src/main/java/com/zcloud/controller/reportedIncident/ReportedIncidentController.java index 93f0a97..e7d0b3a 100644 --- a/src/main/java/com/zcloud/controller/reportedIncident/ReportedIncidentController.java +++ b/src/main/java/com/zcloud/controller/reportedIncident/ReportedIncidentController.java @@ -30,11 +30,6 @@ public class ReportedIncidentController extends BaseController { @Autowired private ReportedIncidentService reportedIncidentService; - @Autowired - private ImgFilesService imgfilesService; - - @Autowired - private ScrapManageService scrapManageService; /** * 新增 @@ -139,10 +134,10 @@ public class ReportedIncidentController extends BaseController { * @param * @throws Exception */ - @RequestMapping(value="/goEdit") + @RequestMapping(value = "/goEdit") @ResponseBody - public Object goEdit() throws Exception{ - Map map = new HashMap(); + public Object goEdit() throws Exception { + Map map = new HashMap(); String errInfo = "success"; PageData pd = new PageData(); pd = this.getPageData(); diff --git a/src/main/java/com/zcloud/controller/scrapManage/ScrapManageController.java b/src/main/java/com/zcloud/controller/scrapManage/ScrapManageController.java index c2c5ac5..be853f7 100644 --- a/src/main/java/com/zcloud/controller/scrapManage/ScrapManageController.java +++ b/src/main/java/com/zcloud/controller/scrapManage/ScrapManageController.java @@ -53,7 +53,7 @@ public class ScrapManageController extends BaseController { pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); pd.put("ISDELETE", "0"); //是否删除(0:有效 1:删除) pd.put("CREATOR", Jurisdiction.getUSER_ID()); //添加人id - pd.put("CREATORNAME", Jurisdiction.getUsername()); //添加人名字 + pd.put("CREATORNAME", Jurisdiction.getName()); //添加人名字 pd.put("CREATTIME", DateUtil.date2Str(new Date())); //添加时间 pd.put("ISSCRAP", "1"); freightTrailerService.editScrapStatus(pd); @@ -75,7 +75,7 @@ public class ScrapManageController extends BaseController { PageData pd = new PageData(); pd = this.getPageData(); pd.put("DELETOR", Jurisdiction.getUSER_ID()); - pd.put("DELETORNAME", Jurisdiction.getUsername()); + pd.put("DELETORNAME", Jurisdiction.getName()); pd.put("DELETTIME", DateUtil.date2Str(new Date())); pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); PageData pageData = scrapManageService.findById(pd); @@ -112,10 +112,10 @@ public class ScrapManageController extends BaseController { pd = this.getPageData(); pd.put("ISDELETE", "0"); //是否删除(0:有效 1:删除) pd.put("CREATOR", Jurisdiction.getUSER_ID()); //添加人id - pd.put("CREATORNAME", Jurisdiction.getUsername()); //添加人名字 + pd.put("CREATORNAME", Jurisdiction.getName()); //添加人名字 pd.put("CREATTIME", DateUtil.date2Str(new Date())); //添加时间 pd.put("OPERATOR", Jurisdiction.getUSER_ID()); //修改人id - pd.put("OPERATORNAME", Jurisdiction.getUsername()); // 修改人名字 + pd.put("OPERATORNAME", Jurisdiction.getName()); // 修改人名字 pd.put("OPERATTIME", DateUtil.date2Str(new Date())); // 修改时间 scrapManageService.edit(pd); map.put("pd", pd); diff --git a/src/main/java/com/zcloud/controller/taxationManage/TaxationManageController.java b/src/main/java/com/zcloud/controller/taxationManage/TaxationManageController.java index beb4408..5c7aeea 100644 --- a/src/main/java/com/zcloud/controller/taxationManage/TaxationManageController.java +++ b/src/main/java/com/zcloud/controller/taxationManage/TaxationManageController.java @@ -32,12 +32,6 @@ public class TaxationManageController extends BaseController { @Autowired private TaxationManageService taxationManageService; - @Autowired - private Smb smb; - - @Autowired - private AssignedManageService assignedManageService; - @Autowired private FreightTrailerService freightTrailerService; @@ -63,8 +57,7 @@ public class TaxationManageController extends BaseController { if ("".equals(pd.getString("EXPIRE_STATUS"))) { String expireDate = pd.getString("EXPIRE_DATE"); String day = DateUtil.getDay(); - boolean flag = DateUtil.compareDate(expireDate, day); - if (flag) { + if (DateUtil.compareDate(expireDate, day)) { pd.put("EXPIRE_STATUS", "1"); } else { pd.put("EXPIRE_STATUS", "0"); @@ -159,15 +152,17 @@ public class TaxationManageController extends BaseController { if (Tools.notEmpty(KEYWORDS)) pd.put("KEYWORDS", KEYWORDS.trim()); pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); page.setPd(pd); - List taxationList = taxationManageService.list(page); //列出MajorDangerSource列表 - taxationList.forEach(taxation -> { - if ("1".equals(taxation.get("ISSCRAP"))) { - taxation.put("ARCHIVES_TYPE", "1"); - } else if ("1".equals(taxation.get("ISASSIGNED"))) { - taxation.put("ARCHIVES_TYPE", "2"); + List varList = taxationManageService.list(page); //列出MajorDangerSource列表 + + varList.stream().anyMatch(data -> { + if ("1".equals(data.getString("ISSCRAP"))) { + data.put("ARCHIVES_TYPE", "1"); + } else if ("1".equals(data.getString("ISASSIGNED"))) { + data.put("ARCHIVES_TYPE", "2"); } + return false; }); - map.put("varList", taxationList); + map.put("varList", varList); map.put("page", page); map.put("result", errInfo); return map; @@ -203,7 +198,7 @@ public class TaxationManageController extends BaseController { .filter(freight -> taxationList.stream() .noneMatch(taxation -> StringUtils.equals(freight.getString("PLATE_NUMBER"), taxation.getString("PLATE_NUMBER")))) .collect(Collectors.toList()); - }else{ + } else { varList = freightTrailerList; } diff --git a/src/main/resources/mybatis/datasource/comprehensive/TrafficSafetyMeetingRecipientMapper.xml b/src/main/resources/mybatis/datasource/comprehensive/TrafficSafetyMeetingRecipientMapper.xml index f15bc66..555cf8d 100644 --- a/src/main/resources/mybatis/datasource/comprehensive/TrafficSafetyMeetingRecipientMapper.xml +++ b/src/main/resources/mybatis/datasource/comprehensive/TrafficSafetyMeetingRecipientMapper.xml @@ -153,7 +153,7 @@ and u.NAME = #{pd.PRACTITIONER} - and f.PRACTITIONER_TYPE = #{pd.PRACTITIONER_TYPE} + and sd.BIANMA = #{pd.PRACTITIONER_TYPE} and f.ATTENDANCE_STATUS = #{pd.ATTENDANCE_STATUS} diff --git a/src/main/resources/mybatis/datasource/comprehensive/TrafficSafetyOccupationalHazardsMapper.xml b/src/main/resources/mybatis/datasource/comprehensive/TrafficSafetyOccupationalHazardsMapper.xml index 0a2a323..a732eb9 100644 --- a/src/main/resources/mybatis/datasource/comprehensive/TrafficSafetyOccupationalHazardsMapper.xml +++ b/src/main/resources/mybatis/datasource/comprehensive/TrafficSafetyOccupationalHazardsMapper.xml @@ -153,6 +153,7 @@ and COALESCE(c.VALIDSTATUS, '0') = #{pd.VALIDSTATUS} + GROUP BY u.NAME ORDER BY c.OPERATTIME DESC diff --git a/src/main/resources/mybatis/datasource/comprehensive/TrafficSafetyResponsibilityMapper.xml b/src/main/resources/mybatis/datasource/comprehensive/TrafficSafetyResponsibilityMapper.xml index 688967a..ec31ea5 100644 --- a/src/main/resources/mybatis/datasource/comprehensive/TrafficSafetyResponsibilityMapper.xml +++ b/src/main/resources/mybatis/datasource/comprehensive/TrafficSafetyResponsibilityMapper.xml @@ -153,6 +153,7 @@ and COALESCE(c.VALIDSTATUS, '0') = #{pd.VALIDSTATUS} + GROUP BY u.NAME ORDER BY c.OPERATTIME DESC diff --git a/src/main/resources/mybatis/datasource/comprehensive/TrafficSecurityCommitmentMapper.xml b/src/main/resources/mybatis/datasource/comprehensive/TrafficSecurityCommitmentMapper.xml index 995eecc..5cd0b39 100644 --- a/src/main/resources/mybatis/datasource/comprehensive/TrafficSecurityCommitmentMapper.xml +++ b/src/main/resources/mybatis/datasource/comprehensive/TrafficSecurityCommitmentMapper.xml @@ -162,6 +162,8 @@ and COALESCE(c.VALIDSTATUS, '0') = #{pd.VALIDSTATUS} + GROUP BY u.NAME + ORDER BY c.OPERATTIME DESC diff --git a/src/main/resources/mybatis/datasource/equipmentFacility/EquipmentFacilityMapper.xml b/src/main/resources/mybatis/datasource/equipmentFacility/EquipmentFacilityMapper.xml index f66afcd..b3a6f94 100644 --- a/src/main/resources/mybatis/datasource/equipmentFacility/EquipmentFacilityMapper.xml +++ b/src/main/resources/mybatis/datasource/equipmentFacility/EquipmentFacilityMapper.xml @@ -350,6 +350,7 @@ and f.FACILITY_LOCALTION LIKE CONCAT(CONCAT('%', #{pd.FACILITY_LOCALTION}),'%') + ORDER BY f.OPERATTIME DESC diff --git a/src/main/resources/mybatis/datasource/safetyInvestment/SafetyInvestmentPlanMapper.xml b/src/main/resources/mybatis/datasource/safetyInvestment/SafetyInvestmentPlanMapper.xml index 136fc7b..0cb664e 100644 --- a/src/main/resources/mybatis/datasource/safetyInvestment/SafetyInvestmentPlanMapper.xml +++ b/src/main/resources/mybatis/datasource/safetyInvestment/SafetyInvestmentPlanMapper.xml @@ -145,7 +145,7 @@ and f.STATUS = #{pd.STATUS} - order by f.PLAN_YEAR DESC, f.PLAN_PERIOD, f.STATUS = 0 desc, f.CREATTIME desc + order by f.PLAN_YEAR DESC, f.PLAN_PERIOD, f.STATUS = 0 desc, f.OPERATTIME desc @@ -164,7 +164,7 @@ ISDELETE = '1' where SAFETYINVESTMENTPLAN_ID in - + #{item} diff --git a/src/main/resources/mybatis/datasource/safetyInvestment/SafetyInvestmentUseMapper.xml b/src/main/resources/mybatis/datasource/safetyInvestment/SafetyInvestmentUseMapper.xml index 61edcda..f81b5d6 100644 --- a/src/main/resources/mybatis/datasource/safetyInvestment/SafetyInvestmentUseMapper.xml +++ b/src/main/resources/mybatis/datasource/safetyInvestment/SafetyInvestmentUseMapper.xml @@ -151,7 +151,7 @@ ISDELETE = '1' where SAFETYINVESTMENTUSE_ID in - + #{item}