diff --git a/src/main/java/com/zcloud/controller/comprehensive/TrafficDrivingCommitmentController.java b/src/main/java/com/zcloud/controller/comprehensive/TrafficDrivingCommitmentController.java index b683ffc..bdb5852 100644 --- a/src/main/java/com/zcloud/controller/comprehensive/TrafficDrivingCommitmentController.java +++ b/src/main/java/com/zcloud/controller/comprehensive/TrafficDrivingCommitmentController.java @@ -71,6 +71,7 @@ public class TrafficDrivingCommitmentController extends BaseController { pd.put("OPERATOR", Jurisdiction.getUSER_ID()); //操作人 pd.put("OPERATORNAME", Jurisdiction.getName()); //操作人 pd.put("OPERATTIME", DateUtil.date2Str(new Date())); //操作时间 + pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); trafficDrivingCommitmentService.edit(pd); map.put("pd",pd); @@ -109,6 +110,7 @@ public class TrafficDrivingCommitmentController extends BaseController { 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()); trafficDrivingCommitmentService.delete(pd); map.put("result", errInfo); return map; @@ -125,6 +127,7 @@ public class TrafficDrivingCommitmentController extends BaseController { Map map = new HashMap<>(); String errInfo = "success"; PageData pd = this.getPageData(); + pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); pd = trafficDrivingCommitmentService.findById(pd); // 根据ID读取 map.put("pd", pd); map.put("result", errInfo); diff --git a/src/main/java/com/zcloud/controller/comprehensive/TrafficDrivingTypeController.java b/src/main/java/com/zcloud/controller/comprehensive/TrafficDrivingTypeController.java index a0f7314..a40988d 100644 --- a/src/main/java/com/zcloud/controller/comprehensive/TrafficDrivingTypeController.java +++ b/src/main/java/com/zcloud/controller/comprehensive/TrafficDrivingTypeController.java @@ -64,6 +64,7 @@ public class TrafficDrivingTypeController extends BaseController { pd.put("OPERATOR", Jurisdiction.getUSER_ID()); //操作人 pd.put("OPERATORNAME", Jurisdiction.getName()); //操作人 pd.put("OPERATTIME", DateUtil.date2Str(new Date())); //操作时间 + pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); trafficDrivingTypeService.edit(pd); map.put("pd",pd); @@ -104,6 +105,7 @@ public class TrafficDrivingTypeController extends BaseController { 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()); trafficDrivingTypeService.delete(pd); map.put("result", errInfo); return map; @@ -120,6 +122,7 @@ public class TrafficDrivingTypeController extends BaseController { Map map = new HashMap<>(); String errInfo = "success"; PageData pd = this.getPageData(); + pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); pd = trafficDrivingTypeService.findById(pd); // 根据ID读取 map.put("pd", pd); map.put("result", errInfo); diff --git a/src/main/java/com/zcloud/controller/comprehensive/TrafficSecurityCustomerManagementController.java b/src/main/java/com/zcloud/controller/comprehensive/TrafficSecurityCustomerManagementController.java index 104ef5a..f81fcc6 100644 --- a/src/main/java/com/zcloud/controller/comprehensive/TrafficSecurityCustomerManagementController.java +++ b/src/main/java/com/zcloud/controller/comprehensive/TrafficSecurityCustomerManagementController.java @@ -112,6 +112,7 @@ public class TrafficSecurityCustomerManagementController extends BaseController 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()); customerManagementService.delete(pd); map.put("result", errInfo); return map; @@ -139,9 +140,11 @@ public class TrafficSecurityCustomerManagementController extends BaseController String errInfo = "success"; PageData pd = new PageData(); pd = this.getPageData(); + pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); pd = customerManagementService.getTrafficCustomerSelectView(pd); //根据ID读取客户管理信息 PageData pageData = new PageData(); pageData.put("CUSTOMERMANAGEMENT_ID", pd.getString("CUSTOMERMANAGEMENT_ID")); + pageData.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); List customercontactList = customerManagementService.findByCustomerManagementId(pageData); pd.put("customercontactList", customercontactList); map.put("pd", pd); @@ -159,6 +162,7 @@ public class TrafficSecurityCustomerManagementController extends BaseController pd.put("OPERATOR", Jurisdiction.getUSER_ID()); // 修改人id pd.put("OPERATORNAME", Jurisdiction.getName()); // 修改人姓名 pd.put("OPERATTIME", DateUtil.date2Str(new Date())); // 修改时间 + pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); // 修改 客户管理表 customerManagementService.edit(pd); if (pd.getString("contacts") != null && !pd.getString("contacts").isEmpty()) { @@ -206,6 +210,7 @@ public class TrafficSecurityCustomerManagementController extends BaseController 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()); customerManagementService.deleteContactById(pd); map.put("result", errInfo); return map; diff --git a/src/main/java/com/zcloud/controller/comprehensive/TrafficSecurityLocationManagementController.java b/src/main/java/com/zcloud/controller/comprehensive/TrafficSecurityLocationManagementController.java index 6d62532..1b684ca 100644 --- a/src/main/java/com/zcloud/controller/comprehensive/TrafficSecurityLocationManagementController.java +++ b/src/main/java/com/zcloud/controller/comprehensive/TrafficSecurityLocationManagementController.java @@ -64,7 +64,6 @@ public class TrafficSecurityLocationManagementController extends BaseController public Object listForSecurityLocationManagement(Page page) throws Exception { Map map = new HashMap(); String errInfo = "success"; - PageData pd = new PageData(); pd = this.getPageData(); pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); //企业ID @@ -91,6 +90,7 @@ public class TrafficSecurityLocationManagementController extends BaseController pd.put("DELETOR", Jurisdiction.getUSER_ID());//删除人id pd.put("DELETORNAME", Jurisdiction.getUsername());//删除人姓名 pd.put("DELETETIME", DateUtil.date2Str(new Date()));//删除时间 + pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); locationManagementService.delete(pd); map.put("result", errInfo); return map; @@ -138,7 +138,7 @@ public class TrafficSecurityLocationManagementController extends BaseController pd.put("OPERATOR", Jurisdiction.getUSER_ID()); // 修改人id pd.put("OPERATORNAME", Jurisdiction.getName()); // 修改人姓名 pd.put("OPERATTIME", DateUtil.date2Str(new Date())); // 修改时间 - + pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); locationManagementService.edit(pd); map.put("result", errInfo); diff --git a/src/main/java/com/zcloud/controller/comprehensive/TrafficSecurityWaybillRegistrationController.java b/src/main/java/com/zcloud/controller/comprehensive/TrafficSecurityWaybillRegistrationController.java index 87dc329..59cc637 100644 --- a/src/main/java/com/zcloud/controller/comprehensive/TrafficSecurityWaybillRegistrationController.java +++ b/src/main/java/com/zcloud/controller/comprehensive/TrafficSecurityWaybillRegistrationController.java @@ -21,6 +21,7 @@ import org.springframework.web.multipart.MultipartFile; import javax.annotation.Resource; import java.util.*; +import java.util.stream.Collectors; @Controller @RequestMapping("/waybillregistration") @@ -186,15 +187,19 @@ public class TrafficSecurityWaybillRegistrationController extends BaseController pd = this.getPageData(); pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); pd = trafficSecurityWaybillRegistrationService.findById(pd);//根据ID读 - - String[] dispatchers = pd.getString("DISPATCHER").split(","); + List dispatchers = Arrays.stream(pd.getString("DISPATCHER").split(",")).collect(Collectors.toList()); List names = new ArrayList<>(); - for (String dispatcher : dispatchers) { + dispatchers.forEach(data -> { PageData user = new PageData(); - user.put("USER_ID", dispatcher.trim()); - PageData pageData1 = usersService.findById(user); - names.add(pageData1); - } + user.put("USER_ID", data.trim()); + PageData userInfo = null; + try { + userInfo = usersService.findById(user); + } catch (Exception e) { + throw new RuntimeException(e); + } + names.add(userInfo); + }); List deptList = usersService.listUserbyDep(pd); pd.put("deptList", deptList); pd.put("names", names); diff --git a/src/main/java/com/zcloud/controller/safetyInvestment/SafetyInvestmentUseController.java b/src/main/java/com/zcloud/controller/safetyInvestment/SafetyInvestmentUseController.java index 44b325f..1b31b83 100644 --- a/src/main/java/com/zcloud/controller/safetyInvestment/SafetyInvestmentUseController.java +++ b/src/main/java/com/zcloud/controller/safetyInvestment/SafetyInvestmentUseController.java @@ -10,7 +10,6 @@ import com.zcloud.util.Jurisdiction; import com.zcloud.util.ObjectExcelView; import com.zcloud.util.Tools; import org.apache.commons.lang.StringUtils; -import org.apache.shiro.authz.annotation.RequiresPermissions; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; @@ -19,7 +18,6 @@ import org.springframework.web.servlet.ModelAndView; import java.util.*; import java.util.stream.Collectors; -import java.util.stream.DoubleStream; /** * 说明:安全投入使用 @@ -60,7 +58,7 @@ public class SafetyInvestmentUseController extends BaseController { } /**删除 - * @param out + * @param * @throws Exception */ @RequestMapping(value="/delete") @@ -72,6 +70,7 @@ public class SafetyInvestmentUseController extends BaseController { String errInfo = "success"; PageData pd = new PageData(); pd = this.getPageData(); + pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); safetyinvestmentuseService.delete(pd); map.put("result", errInfo); //返回结果 return map; @@ -90,6 +89,7 @@ public class SafetyInvestmentUseController extends BaseController { String errInfo = "success"; PageData pd = new PageData(); pd = this.getPageData(); + pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); safetyinvestmentuseService.edit(pd); map.put("result", errInfo); return map; @@ -111,6 +111,7 @@ public class SafetyInvestmentUseController extends BaseController { String KEYWORDS = pd.getString("KEYWORDS"); //关键词检索条件 if(Tools.notEmpty(KEYWORDS))pd.put("KEYWORDS", KEYWORDS.trim()); page.setPd(pd); + pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); List varList = safetyinvestmentuseService.list(page); //列出SafetyInvestmentUse列表 map.put("varList", varList); map.put("page", page); @@ -119,7 +120,7 @@ public class SafetyInvestmentUseController extends BaseController { } /**列表 - * @param page + * @param * @throws Exception */ @RequestMapping(value="/listAll") @@ -138,11 +139,20 @@ public class SafetyInvestmentUseController extends BaseController { filter(data -> StringUtils.equals(data.getString("USE_TYPE"), "1")) .mapToDouble(data -> Double.valueOf(data.getString("AMOUNT"))).sum(); - varList.forEach(data -> { - }); + // 计算所有支出项目合计 + List allOutlayTotalList = new ArrayList<>(); + varList.stream().filter(data -> StringUtils.equals(data.getString("USE_TYPE"), "2")) + .collect(Collectors.groupingBy(data -> data.getString("TYPE"))).forEach((key, value) -> { + PageData pageData = new PageData(); + double total = value.stream().mapToDouble(data -> Double.valueOf(data.getString("AMOUNT"))).sum(); + pageData.put("type", key); + pageData.put("total", total); + allOutlayTotalList.add(pageData); + }); - map.put("drawingsTotal", drawingsTotal); map.put("varList", varList); + map.put("drawingsTotal", drawingsTotal); + map.put("allOutlayTotalList", allOutlayTotalList); map.put("result", errInfo); return map; } @@ -187,7 +197,7 @@ public class SafetyInvestmentUseController extends BaseController { }else{ errInfo = "error"; } - map.put("result", errInfo); //返回结果 + map.put("result", errInfo); //返回结果 return map; } diff --git a/src/main/resources/mybatis/datasource/comprehensive/TrafficDrivingCommitmentMapper.xml b/src/main/resources/mybatis/datasource/comprehensive/TrafficDrivingCommitmentMapper.xml index e18b0e8..097ed9f 100644 --- a/src/main/resources/mybatis/datasource/comprehensive/TrafficDrivingCommitmentMapper.xml +++ b/src/main/resources/mybatis/datasource/comprehensive/TrafficDrivingCommitmentMapper.xml @@ -87,6 +87,8 @@ OPERATTIME = #{OPERATTIME} where DRIVINGCOMMITMENT_ID = #{DRIVINGCOMMITMENT_ID} + and + CORPINFO_ID = #{CORPINFO_ID} @@ -122,6 +124,8 @@ f where f.DRIVINGCOMMITMENT_ID = #{DRIVINGCOMMITMENT_ID} + AND + f.CORPINFO_ID = #{CORPINFO_ID} @@ -134,5 +138,7 @@ DELETETIME = #{DELETETIME} where DRIVINGCOMMITMENT_ID = #{DRIVINGCOMMITMENT_ID} + AND + CORPINFO_ID = #{CORPINFO_ID} diff --git a/src/main/resources/mybatis/datasource/comprehensive/TrafficDrivingTypeMapper.xml b/src/main/resources/mybatis/datasource/comprehensive/TrafficDrivingTypeMapper.xml index 540849d..5fdbf0b 100644 --- a/src/main/resources/mybatis/datasource/comprehensive/TrafficDrivingTypeMapper.xml +++ b/src/main/resources/mybatis/datasource/comprehensive/TrafficDrivingTypeMapper.xml @@ -93,6 +93,8 @@ OPERATTIME = #{OPERATTIME} where DRIVINGTYPE_ID = #{DRIVINGTYPE_ID} + AND + CORPINFO_ID = #{CORPINFO_ID} @@ -119,6 +121,8 @@ f where f.DRIVINGTYPE_ID = #{DRIVINGTYPE_ID} + AND + f.CORPINFO_ID = #{CORPINFO_ID} @@ -132,6 +136,8 @@ DELETETIME = #{DELETETIME} where DRIVINGTYPE_ID = #{DRIVINGTYPE_ID} + AND + CORPINFO_ID = #{CORPINFO_ID} diff --git a/src/main/resources/mybatis/datasource/safetyInvestment/SafetyInvestmentUseMapper.xml b/src/main/resources/mybatis/datasource/safetyInvestment/SafetyInvestmentUseMapper.xml index f81b5d6..4b91901 100644 --- a/src/main/resources/mybatis/datasource/safetyInvestment/SafetyInvestmentUseMapper.xml +++ b/src/main/resources/mybatis/datasource/safetyInvestment/SafetyInvestmentUseMapper.xml @@ -79,6 +79,8 @@ ISDELETE = '1' where SAFETYINVESTMENTUSE_ID = #{SAFETYINVESTMENTUSE_ID} + AND + CORPINFO_ID = #{CORPINFO_ID} @@ -99,6 +101,8 @@ SAFETYINVESTMENTUSE_ID = SAFETYINVESTMENTUSE_ID where SAFETYINVESTMENTUSE_ID = #{SAFETYINVESTMENTUSE_ID} + AND + CORPINFO_ID = #{CORPINFO_ID} @@ -117,7 +121,7 @@ from f - where f.ISDELETE = '0' + where f.ISDELETE = '0' and f.CORPINFO_ID = #{pd.CORPINFO_ID} and (