forked from integrated_whb/integrated_whb
BUG优化
parent
9105864b91
commit
c3b5ed3417
|
@ -1,5 +1,6 @@
|
||||||
package com.zcloud.controller.comprehensive;
|
package com.zcloud.controller.comprehensive;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import com.alibaba.fastjson.JSON;
|
import com.alibaba.fastjson.JSON;
|
||||||
import com.alibaba.fastjson.JSONArray;
|
import com.alibaba.fastjson.JSONArray;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
@ -157,18 +158,44 @@ public class TrafficSecurityCustomerManagementController extends BaseController
|
||||||
pd.put("OPERATTIME", DateUtil.date2Str(new Date())); // 修改时间
|
pd.put("OPERATTIME", DateUtil.date2Str(new Date())); // 修改时间
|
||||||
// 修改 客户管理表
|
// 修改 客户管理表
|
||||||
customerManagementService.edit(pd);
|
customerManagementService.edit(pd);
|
||||||
|
List<PageData> contacts = JSONArray.parseArray(pd.getString("contacts"), PageData.class);
|
||||||
String[] customercontactIds = pd.getString("CUSTOMERCONTACT_ID").split(",");
|
for (PageData contact : contacts) {
|
||||||
for (String customercontactId : customercontactIds) {
|
PageData contactInfo = customerManagementService.findByContactId(contact.getString("CUSTOMERCONTACT_ID"));
|
||||||
List<PageData> contacts = JSONObject.parseArray(pd.getString("contacts"), PageData.class);
|
if(ObjectUtil.isEmpty(contactInfo)) {
|
||||||
for (PageData contact : contacts) {
|
PageData pageData = new PageData();
|
||||||
if(StringUtils.equals(contact.getString("CUSTOMERCONTACT_ID"), customercontactId)) {
|
pageData.put("CUSTOMERADDRESS_ID", this.get32UUID());
|
||||||
customerManagementService.editUserInfo(contact);
|
pageData.put("ISDELETE", 0);
|
||||||
}
|
pageData.put("CUSTOMERCONTACT_ID", this.get32UUID());
|
||||||
|
pageData.put("CREATOR", Jurisdiction.getUSER_ID());
|
||||||
|
pageData.put("CREATORNAME", Jurisdiction.getUsername());
|
||||||
|
pageData.put("CUSTOMERMANAGEMENT_ID",pd.getString("CUSTOMERMANAGEMENT_ID"));
|
||||||
|
pageData.put("CONTACT_ID", this.get32UUID());
|
||||||
|
pageData.put("CREATETIME", DateUtil.date2Str(new Date()));
|
||||||
|
pageData.put("CONTACT", contact.getString("CONTACT"));
|
||||||
|
pageData.put("CUSTOMERADDRESS", contact.getString("CUSTOMERADDRESS"));
|
||||||
|
pageData.put("CONTACTPHONE", contact.getString("CONTACTPHONE"));
|
||||||
|
customerManagementService.saveContact(pageData);
|
||||||
|
}else{
|
||||||
|
customerManagementService.editContactInfo(contact);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
map.put("result", errInfo);
|
map.put("result", errInfo);
|
||||||
map.put("pd", pd);
|
map.put("pd", pd);
|
||||||
return map;
|
return map;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@RequestMapping(value = "/deleteContactInfo")
|
||||||
|
@ResponseBody
|
||||||
|
public Object deleteContactInfo() throws Exception {
|
||||||
|
Map<String, String> map = new HashMap<String, String>();
|
||||||
|
String errInfo = "success";
|
||||||
|
PageData pd = new PageData();
|
||||||
|
pd = this.getPageData();
|
||||||
|
pd.put("DELETOR", Jurisdiction.getUSER_ID());//删除人id
|
||||||
|
pd.put("DELETORNAME", Jurisdiction.getUsername());//删除人姓名
|
||||||
|
pd.put("DELETETIME", DateUtil.date2Str(new Date()));//删除时间
|
||||||
|
customerManagementService.deleteContactById(pd);
|
||||||
|
map.put("result", errInfo);
|
||||||
|
return map;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,4 +16,8 @@ public interface TrafficSecurityCustomerContactMapper {
|
||||||
void deleteContact(PageData pd2);
|
void deleteContact(PageData pd2);
|
||||||
|
|
||||||
PageData findByContactName(PageData pd);
|
PageData findByContactName(PageData pd);
|
||||||
|
|
||||||
|
PageData findByContactId(String pd);
|
||||||
|
|
||||||
|
void deleteContactById(PageData pd);
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,4 +31,8 @@ public interface TrafficSecurityCustomerManagementService {
|
||||||
void editUserInfo(PageData pd);
|
void editUserInfo(PageData pd);
|
||||||
|
|
||||||
PageData findByContactName(PageData pd2);
|
PageData findByContactName(PageData pd2);
|
||||||
|
|
||||||
|
PageData findByContactId(String pd);
|
||||||
|
|
||||||
|
void deleteContactById(PageData pd);
|
||||||
}
|
}
|
||||||
|
|
|
@ -80,4 +80,14 @@ public class TrafficSecurityCustomerManagementServiceImpl implements TrafficSecu
|
||||||
public PageData findByContactName(PageData pd) {
|
public PageData findByContactName(PageData pd) {
|
||||||
return customerContactMapper.findByContactName(pd);
|
return customerContactMapper.findByContactName(pd);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PageData findByContactId(String pd) {
|
||||||
|
return customerContactMapper.findByContactId(pd);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void deleteContactById(PageData pd) {
|
||||||
|
customerContactMapper.deleteContactById(pd);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -121,6 +121,17 @@
|
||||||
CUSTOMERMANAGEMENT_ID = #{CUSTOMERMANAGEMENT_ID}
|
CUSTOMERMANAGEMENT_ID = #{CUSTOMERMANAGEMENT_ID}
|
||||||
</delete>
|
</delete>
|
||||||
|
|
||||||
|
<delete id="deleteContactById">
|
||||||
|
update
|
||||||
|
<include refid="tableName"></include>
|
||||||
|
set
|
||||||
|
ISDELETE = '1',
|
||||||
|
DELETOR = #{DELETOR},
|
||||||
|
DELETETIME = #{DELETETIME}
|
||||||
|
where
|
||||||
|
CUSTOMERCONTACT_ID = #{CUSTOMERCONTACT_ID }
|
||||||
|
</delete>
|
||||||
|
|
||||||
<select id="findByCustomerManagementId" resultType="com.zcloud.entity.PageData" parameterType="pd">
|
<select id="findByCustomerManagementId" resultType="com.zcloud.entity.PageData" parameterType="pd">
|
||||||
select
|
select
|
||||||
<include refid="Field"></include>
|
<include refid="Field"></include>
|
||||||
|
@ -128,7 +139,7 @@
|
||||||
<include refid="tableName"></include> f
|
<include refid="tableName"></include> f
|
||||||
where f.ISDELETE = 0
|
where f.ISDELETE = 0
|
||||||
AND f.CUSTOMERMANAGEMENT_ID = #{CUSTOMERMANAGEMENT_ID}
|
AND f.CUSTOMERMANAGEMENT_ID = #{CUSTOMERMANAGEMENT_ID}
|
||||||
ORDER BY f.OPERATTIME asc
|
ORDER BY f.CREATETIME ASC
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="findByContactName" resultType="com.zcloud.entity.PageData" parameterType="pd">
|
<select id="findByContactName" resultType="com.zcloud.entity.PageData" parameterType="pd">
|
||||||
|
@ -142,5 +153,14 @@
|
||||||
f.ISDELETE = 0
|
f.ISDELETE = 0
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="findByContactId" resultType="com.zcloud.entity.PageData" parameterType="pd">
|
||||||
|
select
|
||||||
|
f.*
|
||||||
|
from
|
||||||
|
<include refid="tableName"/> f
|
||||||
|
where f.ISDELETE = 0
|
||||||
|
AND f.CUSTOMERCONTACT_ID = #{CUSTOMERCONTACT_ID}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
Loading…
Reference in New Issue