From 9105864b917a1642b1c7d337bcaa71aee06648ff Mon Sep 17 00:00:00 2001 From: xiepeng Date: Mon, 15 Apr 2024 18:00:41 +0800 Subject: [PATCH] =?UTF-8?q?BUG=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...cSecurityCustomerManagementController.java | 33 +++++-------------- ...cSecurityLocationManagementController.java | 1 + ...SecurityWaybillRegistrationController.java | 14 ++++++++ .../TrafficSecurityCustomerContactMapper.java | 2 ++ ...afficSecurityCustomerManagementMapper.java | 1 + ...fficSecurityCustomerManagementService.java | 4 +++ ...SecurityCustomerManagementServiceImpl.java | 10 ++++++ .../TrafficSecurityCustomerContactMapper.xml | 11 +++++++ ...rafficSecurityCustomerManagementMapper.xml | 1 + ...afficSecurityWaybillRegistrationMapper.xml | 10 ++++-- 10 files changed, 60 insertions(+), 27 deletions(-) diff --git a/src/main/java/com/zcloud/controller/comprehensive/TrafficSecurityCustomerManagementController.java b/src/main/java/com/zcloud/controller/comprehensive/TrafficSecurityCustomerManagementController.java index af75e43..19fa184 100644 --- a/src/main/java/com/zcloud/controller/comprehensive/TrafficSecurityCustomerManagementController.java +++ b/src/main/java/com/zcloud/controller/comprehensive/TrafficSecurityCustomerManagementController.java @@ -1,6 +1,8 @@ package com.zcloud.controller.comprehensive; import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; import com.zcloud.controller.base.BaseController; import com.zcloud.entity.Page; import com.zcloud.entity.PageData; @@ -10,7 +12,7 @@ import com.zcloud.util.Const; import com.zcloud.util.DateUtil; import com.zcloud.util.Jurisdiction; import com.zcloud.util.Tools; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.StringUtils; import org.apache.tomcat.util.json.JSONParser; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; @@ -156,30 +158,13 @@ public class TrafficSecurityCustomerManagementController extends BaseController // 修改 客户管理表 customerManagementService.edit(pd); - PageData pd2 = new PageData(); - pd2.put("CUSTOMERMANAGEMENT_ID", pd.getString("CUSTOMERMANAGEMENT_ID")); - pd2.put("DELETOR", Jurisdiction.getUSER_ID()); - pd2.put("DELETORNAME", Jurisdiction.getUsername()); - pd2.put("DELETETIME", DateUtil.date2Str(new Date())); - customerManagementService.deleteContact(pd2); - - if (pd.getString("contacts") != null && !pd.getString("contacts").isEmpty()) { - List contacts = JSON.parseArray(pd.getString("contacts"), PageData.class); + String[] customercontactIds = pd.getString("CUSTOMERCONTACT_ID").split(","); + for (String customercontactId : customercontactIds) { + List contacts = JSONObject.parseArray(pd.getString("contacts"), PageData.class); for (PageData contact : contacts) { - PageData contactPd = new PageData(); - contactPd.put("CUSTOMERCONTACT_ID", this.get32UUID()); - contactPd.put("CONTACT_ID", this.get32UUID()); - contactPd.put("CUSTOMERADDRESS_ID", this.get32UUID()); - contactPd.put("CUSTOMERMANAGEMENT_ID", pd.getString("CUSTOMERMANAGEMENT_ID")); - contactPd.put("CREATOR", Jurisdiction.getUSER_ID()); // 设置创建人ID - contactPd.put("CREATORNAME", Jurisdiction.getName()); // 设置创建人姓名 - contactPd.put("CREATETIME", DateUtil.date2Str(new Date())); // 设置创建时间 - contactPd.put("CONTACT", contact.get("CONTACT")); - contactPd.put("CONTACTPHONE", contact.get("CONTACTPHONE")); - contactPd.put("CUSTOMERADDRESS", contact.get("CUSTOMERADDRESS")); - contactPd.put("ISDELETE", "0"); // 设置删除标志 - - customerManagementService.saveContact(contactPd); + if(StringUtils.equals(contact.getString("CUSTOMERCONTACT_ID"), customercontactId)) { + customerManagementService.editUserInfo(contact); + } } } map.put("result", errInfo); diff --git a/src/main/java/com/zcloud/controller/comprehensive/TrafficSecurityLocationManagementController.java b/src/main/java/com/zcloud/controller/comprehensive/TrafficSecurityLocationManagementController.java index 2e0c98d..6d62532 100644 --- a/src/main/java/com/zcloud/controller/comprehensive/TrafficSecurityLocationManagementController.java +++ b/src/main/java/com/zcloud/controller/comprehensive/TrafficSecurityLocationManagementController.java @@ -6,6 +6,7 @@ import com.alibaba.fastjson.JSONObject; import com.zcloud.controller.base.BaseController; import com.zcloud.entity.Page; import com.zcloud.entity.PageData; +import com.zcloud.service.comprehensive.TrafficSecurityCustomerManagementService; import com.zcloud.service.comprehensive.TrafficSecurityLocationManagementService; import com.zcloud.util.DateUtil; import com.zcloud.util.Jurisdiction; diff --git a/src/main/java/com/zcloud/controller/comprehensive/TrafficSecurityWaybillRegistrationController.java b/src/main/java/com/zcloud/controller/comprehensive/TrafficSecurityWaybillRegistrationController.java index 800ea4a..7ad7c2d 100644 --- a/src/main/java/com/zcloud/controller/comprehensive/TrafficSecurityWaybillRegistrationController.java +++ b/src/main/java/com/zcloud/controller/comprehensive/TrafficSecurityWaybillRegistrationController.java @@ -1,5 +1,6 @@ package com.zcloud.controller.comprehensive; +import cn.hutool.core.util.ObjectUtil; import com.zcloud.controller.base.BaseController; import com.zcloud.entity.Page; import com.zcloud.entity.PageData; @@ -9,6 +10,7 @@ import com.zcloud.service.comprehensive.TrafficSecurityCustomerManagementService import com.zcloud.service.comprehensive.TrafficSecurityWaybillRegistrationService; import com.zcloud.service.system.UsersService; import com.zcloud.util.*; +import org.apache.commons.lang.ObjectUtils; import org.apache.commons.lang.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; @@ -225,6 +227,18 @@ public class TrafficSecurityWaybillRegistrationController extends BaseController pd.put("OPERATORNAME", Jurisdiction.getName()); // 修改人姓名 pd.put("OPERATTIME", DateUtil.date2Str(new Date())); // 修改时间 + PageData pd2 = new PageData(); + pd2.put("CONTACT", pd.getString("ENTRUST_PERSON")); + PageData contactInfo = trafficSecurityCustomerManagementService.findByContactName(pd2); + if(!ObjectUtil.isEmpty(contactInfo)) { + pd.put("ENTRUST_PERSON", contactInfo.getString("CONTACT_ID")); + } + PageData pd3 = new PageData(); + pd3.put("CONTACT", pd.getString("CONFIRM_PERSON")); + PageData pageData = trafficSecurityCustomerManagementService.findByContactName(pd3); + if(!ObjectUtil.isEmpty(pageData)) { + pd.put("CONFIRM_PERSON", pageData.getString("CONTACT_ID")); + } trafficSecurityWaybillRegistrationService.edit(pd); map.put("result", errInfo); diff --git a/src/main/java/com/zcloud/mapper/datasource/comprehensive/TrafficSecurityCustomerContactMapper.java b/src/main/java/com/zcloud/mapper/datasource/comprehensive/TrafficSecurityCustomerContactMapper.java index 6d40e3e..c737707 100644 --- a/src/main/java/com/zcloud/mapper/datasource/comprehensive/TrafficSecurityCustomerContactMapper.java +++ b/src/main/java/com/zcloud/mapper/datasource/comprehensive/TrafficSecurityCustomerContactMapper.java @@ -14,4 +14,6 @@ public interface TrafficSecurityCustomerContactMapper { void edit(PageData pd); void deleteContact(PageData pd2); + + PageData findByContactName(PageData pd); } diff --git a/src/main/java/com/zcloud/mapper/datasource/comprehensive/TrafficSecurityCustomerManagementMapper.java b/src/main/java/com/zcloud/mapper/datasource/comprehensive/TrafficSecurityCustomerManagementMapper.java index 03180be..c6856cc 100644 --- a/src/main/java/com/zcloud/mapper/datasource/comprehensive/TrafficSecurityCustomerManagementMapper.java +++ b/src/main/java/com/zcloud/mapper/datasource/comprehensive/TrafficSecurityCustomerManagementMapper.java @@ -32,4 +32,5 @@ public interface TrafficSecurityCustomerManagementMapper { PageData getTrafficCustomerSelectView(PageData pd); void edit(PageData pd); + } diff --git a/src/main/java/com/zcloud/service/comprehensive/TrafficSecurityCustomerManagementService.java b/src/main/java/com/zcloud/service/comprehensive/TrafficSecurityCustomerManagementService.java index ade7a9d..d577c07 100644 --- a/src/main/java/com/zcloud/service/comprehensive/TrafficSecurityCustomerManagementService.java +++ b/src/main/java/com/zcloud/service/comprehensive/TrafficSecurityCustomerManagementService.java @@ -27,4 +27,8 @@ public interface TrafficSecurityCustomerManagementService { void editContactInfo(PageData contact); void deleteContact(PageData pd2); + + void editUserInfo(PageData pd); + + PageData findByContactName(PageData pd2); } diff --git a/src/main/java/com/zcloud/service/comprehensive/impl/TrafficSecurityCustomerManagementServiceImpl.java b/src/main/java/com/zcloud/service/comprehensive/impl/TrafficSecurityCustomerManagementServiceImpl.java index e2f8f78..73fc72d 100644 --- a/src/main/java/com/zcloud/service/comprehensive/impl/TrafficSecurityCustomerManagementServiceImpl.java +++ b/src/main/java/com/zcloud/service/comprehensive/impl/TrafficSecurityCustomerManagementServiceImpl.java @@ -70,4 +70,14 @@ public class TrafficSecurityCustomerManagementServiceImpl implements TrafficSecu public void deleteContact(PageData pd2) { customerContactMapper.deleteContact(pd2); } + + @Override + public void editUserInfo(PageData pd) { + customerContactMapper.edit(pd); + } + + @Override + public PageData findByContactName(PageData pd) { + return customerContactMapper.findByContactName(pd); + } } diff --git a/src/main/resources/mybatis/datasource/comprehensive/TrafficSecurityCustomerContactMapper.xml b/src/main/resources/mybatis/datasource/comprehensive/TrafficSecurityCustomerContactMapper.xml index 50e5720..2e4c86d 100644 --- a/src/main/resources/mybatis/datasource/comprehensive/TrafficSecurityCustomerContactMapper.xml +++ b/src/main/resources/mybatis/datasource/comprehensive/TrafficSecurityCustomerContactMapper.xml @@ -131,5 +131,16 @@ ORDER BY f.OPERATTIME asc + + diff --git a/src/main/resources/mybatis/datasource/comprehensive/TrafficSecurityCustomerManagementMapper.xml b/src/main/resources/mybatis/datasource/comprehensive/TrafficSecurityCustomerManagementMapper.xml index 7aa5ffc..235bc6c 100644 --- a/src/main/resources/mybatis/datasource/comprehensive/TrafficSecurityCustomerManagementMapper.xml +++ b/src/main/resources/mybatis/datasource/comprehensive/TrafficSecurityCustomerManagementMapper.xml @@ -93,6 +93,7 @@ f.CUSTOMERMANAGEMENT_ID = #{CUSTOMERMANAGEMENT_ID} + update diff --git a/src/main/resources/mybatis/datasource/comprehensive/TrafficSecurityWaybillRegistrationMapper.xml b/src/main/resources/mybatis/datasource/comprehensive/TrafficSecurityWaybillRegistrationMapper.xml index e5d880f..5ddb6fd 100644 --- a/src/main/resources/mybatis/datasource/comprehensive/TrafficSecurityWaybillRegistrationMapper.xml +++ b/src/main/resources/mybatis/datasource/comprehensive/TrafficSecurityWaybillRegistrationMapper.xml @@ -162,9 +162,9 @@ f.OPERATOR = #{OPERATOR}, f.OPERATORNAME = #{OPERATORNAME}, f.OPERATTIME = #{OPERATTIME}, - f.CLIENTCONTACTPERSON = #{CLIENTCONTACTPERSON}, + f.CLIENTCONTACTPERSON = #{ENTRUST_PERSON}, f.CLIENTCONTACTPHONE = #{CLIENTCONTACTPHONE}, - f.CONFIRMINGPERSON = #{CONFIRMINGPERSON}, + f.CONFIRMINGPERSON = #{CONFIRM_PERSON}, f.DISPATCHER = #{DISPATCHER}, f.PRACTITIONER = #{PRACTITIONER}, f.SHIPPINGDATE = #{SHIPPINGDATE}, @@ -251,7 +251,11 @@ btcc.CONTACT AS ENTRUST_PERSON, btcc2.CONTACT AS CONFIRM_PERSON, b.ADDRESSDETAILS AS SHIPPING_ADDR, - b2.ADDRESSDETAILS AS DESTINATION_ADDR + b2.ADDRESSDETAILS AS DESTINATION_ADDR, + btcc.CONTACTPHONE AS ENTRUST_PHONE, + btcc2.CONTACTPHONE AS CONFIRM_PHONE, + b.ADMINISTRATIVEREGIONS AS DEPARTURE_ADDR, + b2.ADMINISTRATIVEREGIONS AS GOAL_ADDR from f left join bus_traffic_operatingvehicle e on f.TRANSPORTVEHICLE = e.PLATE_NUMBER