BUG优化

dev
xiepeng 2024-04-15 18:00:41 +08:00
parent a675bb1bfc
commit 9105864b91
10 changed files with 60 additions and 27 deletions

View File

@ -1,6 +1,8 @@
package com.zcloud.controller.comprehensive; package com.zcloud.controller.comprehensive;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.zcloud.controller.base.BaseController; import com.zcloud.controller.base.BaseController;
import com.zcloud.entity.Page; import com.zcloud.entity.Page;
import com.zcloud.entity.PageData; import com.zcloud.entity.PageData;
@ -10,7 +12,7 @@ import com.zcloud.util.Const;
import com.zcloud.util.DateUtil; import com.zcloud.util.DateUtil;
import com.zcloud.util.Jurisdiction; import com.zcloud.util.Jurisdiction;
import com.zcloud.util.Tools; 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.apache.tomcat.util.json.JSONParser;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
@ -156,30 +158,13 @@ public class TrafficSecurityCustomerManagementController extends BaseController
// 修改 客户管理表 // 修改 客户管理表
customerManagementService.edit(pd); customerManagementService.edit(pd);
PageData pd2 = new PageData(); String[] customercontactIds = pd.getString("CUSTOMERCONTACT_ID").split(",");
pd2.put("CUSTOMERMANAGEMENT_ID", pd.getString("CUSTOMERMANAGEMENT_ID")); for (String customercontactId : customercontactIds) {
pd2.put("DELETOR", Jurisdiction.getUSER_ID()); List<PageData> contacts = JSONObject.parseArray(pd.getString("contacts"), PageData.class);
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<PageData> contacts = JSON.parseArray(pd.getString("contacts"), PageData.class);
for (PageData contact : contacts) { for (PageData contact : contacts) {
PageData contactPd = new PageData(); if(StringUtils.equals(contact.getString("CUSTOMERCONTACT_ID"), customercontactId)) {
contactPd.put("CUSTOMERCONTACT_ID", this.get32UUID()); customerManagementService.editUserInfo(contact);
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);
} }
} }
map.put("result", errInfo); map.put("result", errInfo);

View File

@ -6,6 +6,7 @@ import com.alibaba.fastjson.JSONObject;
import com.zcloud.controller.base.BaseController; import com.zcloud.controller.base.BaseController;
import com.zcloud.entity.Page; import com.zcloud.entity.Page;
import com.zcloud.entity.PageData; import com.zcloud.entity.PageData;
import com.zcloud.service.comprehensive.TrafficSecurityCustomerManagementService;
import com.zcloud.service.comprehensive.TrafficSecurityLocationManagementService; import com.zcloud.service.comprehensive.TrafficSecurityLocationManagementService;
import com.zcloud.util.DateUtil; import com.zcloud.util.DateUtil;
import com.zcloud.util.Jurisdiction; import com.zcloud.util.Jurisdiction;

View File

@ -1,5 +1,6 @@
package com.zcloud.controller.comprehensive; package com.zcloud.controller.comprehensive;
import cn.hutool.core.util.ObjectUtil;
import com.zcloud.controller.base.BaseController; import com.zcloud.controller.base.BaseController;
import com.zcloud.entity.Page; import com.zcloud.entity.Page;
import com.zcloud.entity.PageData; 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.comprehensive.TrafficSecurityWaybillRegistrationService;
import com.zcloud.service.system.UsersService; import com.zcloud.service.system.UsersService;
import com.zcloud.util.*; import com.zcloud.util.*;
import org.apache.commons.lang.ObjectUtils;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
@ -225,6 +227,18 @@ public class TrafficSecurityWaybillRegistrationController extends BaseController
pd.put("OPERATORNAME", Jurisdiction.getName()); // 修改人姓名 pd.put("OPERATORNAME", Jurisdiction.getName()); // 修改人姓名
pd.put("OPERATTIME", DateUtil.date2Str(new Date())); // 修改时间 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); trafficSecurityWaybillRegistrationService.edit(pd);
map.put("result", errInfo); map.put("result", errInfo);

View File

@ -14,4 +14,6 @@ public interface TrafficSecurityCustomerContactMapper {
void edit(PageData pd); void edit(PageData pd);
void deleteContact(PageData pd2); void deleteContact(PageData pd2);
PageData findByContactName(PageData pd);
} }

View File

@ -32,4 +32,5 @@ public interface TrafficSecurityCustomerManagementMapper {
PageData getTrafficCustomerSelectView(PageData pd); PageData getTrafficCustomerSelectView(PageData pd);
void edit(PageData pd); void edit(PageData pd);
} }

View File

@ -27,4 +27,8 @@ public interface TrafficSecurityCustomerManagementService {
void editContactInfo(PageData contact); void editContactInfo(PageData contact);
void deleteContact(PageData pd2); void deleteContact(PageData pd2);
void editUserInfo(PageData pd);
PageData findByContactName(PageData pd2);
} }

View File

@ -70,4 +70,14 @@ public class TrafficSecurityCustomerManagementServiceImpl implements TrafficSecu
public void deleteContact(PageData pd2) { public void deleteContact(PageData pd2) {
customerContactMapper.deleteContact(pd2); customerContactMapper.deleteContact(pd2);
} }
@Override
public void editUserInfo(PageData pd) {
customerContactMapper.edit(pd);
}
@Override
public PageData findByContactName(PageData pd) {
return customerContactMapper.findByContactName(pd);
}
} }

View File

@ -131,5 +131,16 @@
ORDER BY f.OPERATTIME asc ORDER BY f.OPERATTIME asc
</select> </select>
<select id="findByContactName" resultType="com.zcloud.entity.PageData" parameterType="pd">
select
f.*
from
<include refid="tableName"></include> f
where
f.CONTACT = #{CONTACT}
AND
f.ISDELETE = 0
</select>
</mapper> </mapper>

View File

@ -93,6 +93,7 @@
f.CUSTOMERMANAGEMENT_ID = #{CUSTOMERMANAGEMENT_ID} f.CUSTOMERMANAGEMENT_ID = #{CUSTOMERMANAGEMENT_ID}
</update> </update>
<!-- 删除--> <!-- 删除-->
<delete id="delete" parameterType="pd"> <delete id="delete" parameterType="pd">
update update

View File

@ -162,9 +162,9 @@
f.OPERATOR = #{OPERATOR}, f.OPERATOR = #{OPERATOR},
f.OPERATORNAME = #{OPERATORNAME}, f.OPERATORNAME = #{OPERATORNAME},
f.OPERATTIME = #{OPERATTIME}, f.OPERATTIME = #{OPERATTIME},
f.CLIENTCONTACTPERSON = #{CLIENTCONTACTPERSON}, f.CLIENTCONTACTPERSON = #{ENTRUST_PERSON},
f.CLIENTCONTACTPHONE = #{CLIENTCONTACTPHONE}, f.CLIENTCONTACTPHONE = #{CLIENTCONTACTPHONE},
f.CONFIRMINGPERSON = #{CONFIRMINGPERSON}, f.CONFIRMINGPERSON = #{CONFIRM_PERSON},
f.DISPATCHER = #{DISPATCHER}, f.DISPATCHER = #{DISPATCHER},
f.PRACTITIONER = #{PRACTITIONER}, f.PRACTITIONER = #{PRACTITIONER},
f.SHIPPINGDATE = #{SHIPPINGDATE}, f.SHIPPINGDATE = #{SHIPPINGDATE},
@ -251,7 +251,11 @@
btcc.CONTACT AS ENTRUST_PERSON, btcc.CONTACT AS ENTRUST_PERSON,
btcc2.CONTACT AS CONFIRM_PERSON, btcc2.CONTACT AS CONFIRM_PERSON,
b.ADDRESSDETAILS AS SHIPPING_ADDR, 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 from
<include refid="tableName"></include> f <include refid="tableName"></include> f
left join bus_traffic_operatingvehicle e on f.TRANSPORTVEHICLE = e.PLATE_NUMBER left join bus_traffic_operatingvehicle e on f.TRANSPORTVEHICLE = e.PLATE_NUMBER