去除无关的TODO标志

dev
IT-xiaoXiong 2021-12-09 10:51:20 +08:00
parent 83958015b2
commit 79c79d1218
13 changed files with 63 additions and 67 deletions

View File

@ -218,7 +218,7 @@ public class WorkflowQueueService {
List<WorkflowBaseInfoDTO> list = new ArrayList<>(); List<WorkflowBaseInfoDTO> list = new ArrayList<>();
// 循环查询流程中时间是否存在冲突 // 循环查询流程中时间是否存在冲突
for (WorkflowConfigDTO workflowConfigDTO : workflowConfigDTOS) { for (WorkflowConfigDTO workflowConfigDTO : workflowConfigDTOS) {
// 查询冲突的流程数据 TODO 流程相关人 查询数据库 // 查询冲突的流程数据 流程相关人 查询数据库
toolUtil.writeErrorLog(hrmStr); toolUtil.writeErrorLog(hrmStr);
toolUtil.writeErrorLog(workflowConfigDTO.toString() + "\n"); toolUtil.writeErrorLog(workflowConfigDTO.toString() + "\n");
for (String hrmId : hrmStr.split(",")) { for (String hrmId : hrmStr.split(",")) {

View File

@ -247,7 +247,7 @@ public class InvoiceService {
* @param requestId * @param requestId
*/ */
public void saveInvoiceInfo(JSONObject invoiceInfo, String requestId) { public void saveInvoiceInfo(JSONObject invoiceInfo, String requestId) {
// TODO 查询是否已经存在,不存在则新增,存在则更新 // 查询是否已经存在,不存在则新增,存在则更新
String query = "select * from " + ModeTable + " where lc = ?"; String query = "select * from " + ModeTable + " where lc = ?";
rs.executeQuery(query, requestId); rs.executeQuery(query, requestId);
if (rs.next()) { if (rs.next()) {
@ -260,7 +260,7 @@ public class InvoiceService {
Util.getIntValue(formModeId, -1), Util.getIntValue(formModeId, -1),
1, 0, TimeUtil.getCurrentDateString(), 1, 0, TimeUtil.getCurrentDateString(),
TimeUtil.getOnlyCurrentTimeString()); TimeUtil.getOnlyCurrentTimeString());
// TODO 插入数据库信息 // 插入数据库信息
invoiceMapping.saveInvoiceInfo(dataId, ModeTable, requestId); invoiceMapping.saveInvoiceInfo(dataId, ModeTable, requestId);
saveInvoiceDetail(invoiceInfo, requestId, String.valueOf(dataId)); saveInvoiceDetail(invoiceInfo, requestId, String.valueOf(dataId));
ModeRightInfo mri = new ModeRightInfo(); ModeRightInfo mri = new ModeRightInfo();

View File

@ -44,7 +44,7 @@ public class UploadByBase64 {
public String uploadImage(@Context HttpServletRequest request, @Context HttpServletResponse response, public String uploadImage(@Context HttpServletRequest request, @Context HttpServletResponse response,
@RequestBody Map<String, String> base64Map) { @RequestBody Map<String, String> base64Map) {
int i = uploadByBase64Service.uploadImage(base64Map); int i = uploadByBase64Service.uploadImage(base64Map);
// TODO 上传完成过后,调用发票识别接口,将数据保存到建模表中 // 上传完成过后,调用发票识别接口,将数据保存到建模表中
User user = HrmUserVarify.getUser(request, response); User user = HrmUserVarify.getUser(request, response);
JSONObject invoiceInfo = null; JSONObject invoiceInfo = null;
try { try {

View File

@ -269,12 +269,12 @@ public class FaDDContractService {
} }
break; break;
case 8: case 8:
// TODO //
// 流程名称 // 流程名称
value = aiyh.utils.Util.getWorkflowNameById(String.valueOf(dataMap.get("workflowid"))); value = aiyh.utils.Util.getWorkflowNameById(String.valueOf(dataMap.get("workflowid")));
break; break;
case 9: case 9:
// TODO //
// 请求标题 // 请求标题
value = aiyh.utils.Util.getRequestTitleById(String.valueOf(dataMap.get("requestid"))); value = aiyh.utils.Util.getRequestTitleById(String.valueOf(dataMap.get("requestid")));
break; break;
@ -330,7 +330,7 @@ public class FaDDContractService {
} }
if ("2".equals(Util.null2String(ufContractInfoDTO.getSignedType()))) { if ("2".equals(Util.null2String(ufContractInfoDTO.getSignedType()))) {
update.put("contract_status", 4); update.put("contract_status", 4);
// TODO 仅对方签署完成后,添加用户信息 // 仅对方签署完成后,添加用户信息
// 获取配置表信息 // 获取配置表信息
FaDaDaConfigDTO faDaDaConfigDTO = faDDContractMapping.queryConfig(String.valueOf(ufContractInfoDTO.getWorkflowType()), 4); FaDaDaConfigDTO faDaDaConfigDTO = faDDContractMapping.queryConfig(String.valueOf(ufContractInfoDTO.getWorkflowType()), 4);
RecordSet rs = new RecordSet(); RecordSet rs = new RecordSet();
@ -384,7 +384,7 @@ public class FaDDContractService {
} }
if ("2".equals(Util.null2String(ufContractInfoDTO.getSignedType()))) { if ("2".equals(Util.null2String(ufContractInfoDTO.getSignedType()))) {
update.put("contract_status", 4); update.put("contract_status", 4);
// TODO 仅对方签署完成后,添加用户信息 // 仅对方签署完成后,添加用户信息
// 获取配置表信息 // 获取配置表信息
FaDaDaConfigDTO faDaDaConfigDTO = faDDContractMapping.queryConfig(String.valueOf(ufContractInfoDTO.getWorkflowType()), 4); FaDaDaConfigDTO faDaDaConfigDTO = faDDContractMapping.queryConfig(String.valueOf(ufContractInfoDTO.getWorkflowType()), 4);
RecordSet rs = new RecordSet(); RecordSet rs = new RecordSet();
@ -530,7 +530,7 @@ public class FaDDContractService {
Util.createPrepWhereImpl().whereAnd("workflow_request_id").whereEqual(ufContractInfoDTO.getWorkflowRequestId())); Util.createPrepWhereImpl().whereAnd("workflow_request_id").whereEqual(ufContractInfoDTO.getWorkflowRequestId()));
rs.executeUpdate(sqlResult.getSqlStr(), sqlResult.getArgs()); rs.executeUpdate(sqlResult.getSqlStr(), sqlResult.getArgs());
updateData.clear(); updateData.clear();
// 更新明细表合同信息 TODO 明细表添加字段signed_status合同方签署状态 // 更新明细表合同信息 明细表添加字段signed_status合同方签署状态
// 签署状态1 已发送待签署2 已签蜀 // 签署状态1 已发送待签署2 已签蜀
updateData.put("signed_status", 1); updateData.put("signed_status", 1);
sqlResult = Util.createSqlBuilder().updateSql(ufContractInfoDTO.getWorkflowDetailTable(), updateData, sqlResult = Util.createSqlBuilder().updateSql(ufContractInfoDTO.getWorkflowDetailTable(), updateData,

View File

@ -278,17 +278,17 @@ public class FaDDServiceImpl implements IFaDDService {
} }
break; break;
case 8: case 8:
// TODO //
// 流程名称 // 流程名称
value = Util.getWorkflowNameById(String.valueOf(dataMap.get("workflowid"))); value = Util.getWorkflowNameById(String.valueOf(dataMap.get("workflowid")));
break; break;
case 9: case 9:
// TODO //
// 请求标题 // 请求标题
value = Util.getRequestTitleById(String.valueOf(dataMap.get("requestid"))); value = Util.getRequestTitleById(String.valueOf(dataMap.get("requestid")));
break; break;
case 10: case 10:
// TODO //
// 流程requestId // 流程requestId
value = dataMap.get("requestid"); value = dataMap.get("requestid");
break; break;
@ -339,10 +339,10 @@ public class FaDDServiceImpl implements IFaDDService {
toolUtil.writeDebuggerLog("转换错误:" + e); toolUtil.writeDebuggerLog("转换错误:" + e);
} }
if ("1".equals(String.valueOf(result.get("status"))) || "6".equals(String.valueOf(result.get("status")))) { if ("1".equals(String.valueOf(result.get("status"))) || "6".equals(String.valueOf(result.get("status")))) {
// 发送请求催一下 TODO 签署合同 // 发送请求催一下 签署合同
notSignedContracts.add(map); notSignedContracts.add(map);
} else { } else {
// 合同状态发生改变,需要修改数据库中的状态信息 TODO 百分百会出问题 // 合同状态发生改变,需要修改数据库中的状态信息 百分百会出问题
map.put("contract_status", result.get("status")); map.put("contract_status", result.get("status"));
// statusList.add() // statusList.add()
faDDServiceMapping.updateContractStatus(map, workflowId, 3); faDDServiceMapping.updateContractStatus(map, workflowId, 3);

View File

@ -215,7 +215,7 @@ public class PatentWallService {
} }
public String handleParsingConf(String parsing, Map<String, Object> data,List<String> args){ public String handleParsingConf(String parsing, Map<String, Object> data,List<String> args){
// TODO 值解析 // 值解析
// 解析 ${}类型的参数,直接替换 // 解析 ${}类型的参数,直接替换
String pattern = "\\$\\{(?<field>(\\s|\\S)+?)}"; String pattern = "\\$\\{(?<field>(\\s|\\S)+?)}";
Pattern compile = Pattern.compile(pattern); Pattern compile = Pattern.compile(pattern);

View File

@ -389,20 +389,16 @@ public class NewUtilTest {
@Test @Test
public void testMessage() { public void testMessage() {
MessageType messageType = MessageType.newInstance(1146); //消息来源(见文档第四点补充)
Set<String> userIdList = new HashSet<>(); //接收人id Set<String> userIdList = new HashSet<>(); //接收人id
userIdList.add("22"); userIdList.add("22");
userIdList.add("23"); userIdList.add("1");
userIdList.add("24"); String linkUrl = "/spa/cube/index.html#/main/cube/search?customid=36"; //PC端链接
String title = "标题"; //标题 String linkMobileUrl = ""; //移动端链接
String context = "内容"; //内容 String title = "我是标题淦";
String linkUrl = ""; //PC端链接 纯文本就传空字符串 String context = "我是内容啊啊啊";
String linkMobileUrl = ""; //移动端链接 纯文本就传空字符串
try { try {
MessageBean messageBean = Util_Message.createMessage(messageType, userIdList, title, context, linkUrl, linkMobileUrl); MessageBean messageBean = Util_Message.createMessage(MessageType.newInstance(1146), userIdList, title, context, linkUrl, linkMobileUrl);
messageBean.setCreater(1);//创建人id messageBean.setCreater(1);//创建人id
//message.setBizState("0");需要修改消息状态时传入,表示消息最初状态为待处理
// messageBean.setTargetId("121|22"); //消息来源code +“|”+业务id 需要修改消息状态时传入,这个字段是自定义的,和修改消息状态的时候传入相同的值,可做更新。
Util_Message.store(messageBean); Util_Message.store(messageBean);
} catch (IOException e) { } catch (IOException e) {
e.printStackTrace(); e.printStackTrace();

View File

@ -36,7 +36,7 @@ public class SyncOrganizationUtils extends ToolUtil {
// 上级部门的id // 上级部门的id
int supDepId = 0; int supDepId = 0;
// 如果该部门是属于根部门,则需要进行分部的同步 // 如果该部门是属于根部门,则需要进行分部的同步
// TODO 查询手动维护的分部信息表将分部信息保存到分部表hrmsubcompany中并且将部门的分部id赋值 // 查询手动维护的分部信息表将分部信息保存到分部表hrmsubcompany中并且将部门的分部id赋值
if (department.getPARENTDEPARTMENDID() == 0) { if (department.getPARENTDEPARTMENDID() == 0) {
// 查询mapping表查看分部与部门的映射关系,通过部门id查询分部信息 // 查询mapping表查看分部与部门的映射关系,通过部门id查询分部信息
String querySql = "select * from uf_sub_mapping where frist_company = " String querySql = "select * from uf_sub_mapping where frist_company = "
@ -75,7 +75,7 @@ public class SyncOrganizationUtils extends ToolUtil {
supDepId = Util.getIntValue(Util.null2String(rs.getString("id"))); supDepId = Util.getIntValue(Util.null2String(rs.getString("id")));
} }
// 处理部门信息 // 处理部门信息
// 查询HR同步配置表用于更新或者插入字段 TODO 查询配置表 // 查询HR同步配置表用于更新或者插入字段 查询配置表
Map<String, Map<String, String>> configTableInfo = this.queryConfigTableInfo(department, getModelValue, "m.api_field_type = 0"); Map<String, Map<String, String>> configTableInfo = this.queryConfigTableInfo(department, getModelValue, "m.api_field_type = 0");
Map<String, String> sysDep = configTableInfo.get("sys"); Map<String, String> sysDep = configTableInfo.get("sys");
Map<String, String> defDep = configTableInfo.get("def"); Map<String, String> defDep = configTableInfo.get("def");
@ -93,7 +93,7 @@ public class SyncOrganizationUtils extends ToolUtil {
int finalSubcompanyid = subcompanyid1; int finalSubcompanyid = subcompanyid1;
if (rs.next()) { if (rs.next()) {
// 存在该部门 // 存在该部门
// 拼接更新SQL TODO // 拼接更新SQL
// 查询父级部门的id并更新 // 查询父级部门的id并更新
String querySupId = "select * from hrmdepartment where outkey = ?"; String querySupId = "select * from hrmdepartment where outkey = ?";
RecordSet r_rs = new RecordSet(); RecordSet r_rs = new RecordSet();
@ -110,13 +110,13 @@ public class SyncOrganizationUtils extends ToolUtil {
Map<String, Object> sysMap = new HashMap<>(); Map<String, Object> sysMap = new HashMap<>();
sysMap.put("modified", this.getTime()); sysMap.put("modified", this.getTime());
this.addDefaultUpdateSql(sysSetSql, sysMap); this.addDefaultUpdateSql(sysSetSql, sysMap);
// 更新数据库 TODO // 更新数据库
this.executeUpdateData(sysSetSql, "hrmdepartment", "id = " + Util.null2String(rs.getString("id"))); this.executeUpdateData(sysSetSql, "hrmdepartment", "id = " + Util.null2String(rs.getString("id")));
this.executeUpdateData(defSetSql, "hrmdepartmentdefined", "deptid = " + Util.null2String(rs.getString("id"))); this.executeUpdateData(defSetSql, "hrmdepartmentdefined", "deptid = " + Util.null2String(rs.getString("id")));
successMark.put("code", "2"); successMark.put("code", "2");
successMark.put("msg", "更新部门" + department.getPARENTDEPARTMENDID() + "成功!"); successMark.put("msg", "更新部门" + department.getPARENTDEPARTMENDID() + "成功!");
} else { } else {
// 拼接插入SQL TODO // 拼接插入SQL
// 不存在部门信息 // 不存在部门信息
Map<String, StringBuilder> insertSysBuilderMap = this.builderSql(sysDep, 2); Map<String, StringBuilder> insertSysBuilderMap = this.builderSql(sysDep, 2);
StringBuilder sysInsertSqlField = insertSysBuilderMap.get("insertField"); StringBuilder sysInsertSqlField = insertSysBuilderMap.get("insertField");
@ -168,7 +168,7 @@ public class SyncOrganizationUtils extends ToolUtil {
public Map<String, String> asyncPosition(Position position) { public Map<String, String> asyncPosition(Position position) {
// writeErrorLog( "---------------"+className+" asyncPosition Begin --------------------"); // writeErrorLog( "---------------"+className+" asyncPosition Begin --------------------");
// TODO 职位同步的SQL // 职位同步的SQL
RecordSet rs = new RecordSet(); RecordSet rs = new RecordSet();
Map<String, String> successMark = new HashMap<>(); Map<String, String> successMark = new HashMap<>();
try { try {
@ -275,7 +275,7 @@ public class SyncOrganizationUtils extends ToolUtil {
} }
// 人员id // 人员id
int hrmid = 0; int hrmid = 0;
// TODO 不知道是否需要判断组织编码是否存在 // 不知道是否需要判断组织编码是否存在
GetModelValue<Employee> getModelValue = new GetModelValue<>(); GetModelValue<Employee> getModelValue = new GetModelValue<>();
RecordSet rs = new RecordSet(); RecordSet rs = new RecordSet();
// 查询配置表信息 // 查询配置表信息
@ -334,7 +334,7 @@ public class SyncOrganizationUtils extends ToolUtil {
this.addDefaultUpdateSql(sysSetSql, sysMap); this.addDefaultUpdateSql(sysSetSql, sysMap);
this.executeUpdateData(sysSetSql, "hrmresource", "id = '" + hrmid + "'"); this.executeUpdateData(sysSetSql, "hrmresource", "id = '" + hrmid + "'");
// TODO 待完善更新自定义人员信息表 // 待完善更新自定义人员信息表
// 判断该字段的scopeid // 判断该字段的scopeid
for (Map.Entry<String, String> entry : defDep.entrySet()) { for (Map.Entry<String, String> entry : defDep.entrySet()) {
// 判断该字段属于的scopeid // 判断该字段属于的scopeid
@ -347,7 +347,7 @@ public class SyncOrganizationUtils extends ToolUtil {
} }
rs.next(); rs.next();
String scopeid = Util.null2String(rs.getString("scopeid")); String scopeid = Util.null2String(rs.getString("scopeid"));
// TODO 判断是否存在该信息,如果存在着更新,不存在着插入 // 判断是否存在该信息,如果存在着更新,不存在着插入
rs.executeQuery("select id from cus_fielddata where id = '" + hrmid + "' and scope = 'HrmCustomFieldByInfoType' and scopeid = '" + scopeid + "'"); rs.executeQuery("select id from cus_fielddata where id = '" + hrmid + "' and scope = 'HrmCustomFieldByInfoType' and scopeid = '" + scopeid + "'");
if (rs.next()) { if (rs.next()) {
// 存在该信息,更新指定信息 // 存在该信息,更新指定信息
@ -530,7 +530,7 @@ public class SyncOrganizationUtils extends ToolUtil {
// 查询该员工的直接上级id => 查询该员工的职位的cmssupjobid对应的职位 // 查询该员工的直接上级id => 查询该员工的职位的cmssupjobid对应的职位
// 由于需要判断该员工的职位是否存在上级职位所以不能一条SQL搞定首先需要查询该员工的职位的上级职位id也就是判断是否存在上级职位 // 由于需要判断该员工的职位是否存在上级职位所以不能一条SQL搞定首先需要查询该员工的职位的上级职位id也就是判断是否存在上级职位
String queryJobTitleId = "select id,cmssupjobid from hrmjobtitles where outkey = ?"; String queryJobTitleId = "select id,cmssupjobid from hrmjobtitles where outkey = ?";
// TODO 不知道需不需要在维护一下职位表中的所属部门id如果需要的haunt将部门id更新进去就可以 // 不知道需不需要在维护一下职位表中的所属部门id如果需要的haunt将部门id更新进去就可以
// 查询当前人员对应的职位id以及cms中的上级职位id // 查询当前人员对应的职位id以及cms中的上级职位id
try { try {
rs.executeQuery(queryJobTitleId, Util.null2String(String.valueOf(employee.getJOBCODEID()))); rs.executeQuery(queryJobTitleId, Util.null2String(String.valueOf(employee.getJOBCODEID())));
@ -841,7 +841,7 @@ public class SyncOrganizationUtils extends ToolUtil {
} }
Map<String, String> sysDep = new HashMap<>(); Map<String, String> sysDep = new HashMap<>();
Map<String, String> defDep = new HashMap<>(); Map<String, String> defDep = new HashMap<>();
// TODO 判断转换规则如果是自定义SQL则需要先执行SQL如果是固定值则需要进行直接赋值如果是不转换则按照默认走 // 判断转换规则如果是自定义SQL则需要先执行SQL如果是固定值则需要进行直接赋值如果是不转换则按照默认走
while (rs.next()) { while (rs.next()) {
String apiFieldType = Util.null2String(rs.getString("api_field_type")); String apiFieldType = Util.null2String(rs.getString("api_field_type"));
String oaFieldType = Util.null2String(rs.getString("oa_field_type")); String oaFieldType = Util.null2String(rs.getString("oa_field_type"));

View File

@ -54,7 +54,7 @@ public class CopyAttachmentSecretAction extends ToolUtil implements Action {
rs_1.executeQuery(query, requestId); rs_1.executeQuery(query, requestId);
Map<String, Object> requestData = Util.recordSet2Map(rs_1); Map<String, Object> requestData = Util.recordSet2Map(rs_1);
toolUtil.writeDebuggerLog(requestData.toString()); toolUtil.writeDebuggerLog(requestData.toString());
// 如果不是第一次添加,则直接返回 TODO 隐藏bug如果用户第一次选择添加后面被退回后将附件清空了重新上传然后又需要安全协议但是已经不是第一次添加了所以并不会生效 // 如果不是第一次添加,则直接返回 隐藏bug如果用户第一次选择添加后面被退回后将附件清空了重新上传然后又需要安全协议但是已经不是第一次添加了所以并不会生效
if (StringUtils.isNullOrEmpty(secretField)) { if (StringUtils.isNullOrEmpty(secretField)) {
if (requestData.get(firstAddField) != null && !Util.null2String(firstAddValue).equals(String.valueOf(requestData.get(firstAddField)))) { if (requestData.get(firstAddField) != null && !Util.null2String(firstAddValue).equals(String.valueOf(requestData.get(firstAddField)))) {
return Action.SUCCESS; return Action.SUCCESS;

View File

@ -186,7 +186,7 @@ public class UploadFile2FaDDAction extends ToolUtil implements Action {
} }
fileInfo.setContractExtension(imagefilename.substring(imagefilename.lastIndexOf("."))); fileInfo.setContractExtension(imagefilename.substring(imagefilename.lastIndexOf(".")));
fileInfo.setContractTitle(imagefilename); fileInfo.setContractTitle(imagefilename);
// TODO fileInfo.setCustomerNo(Util.null2String(detail.get("customer_no"))); // fileInfo.setCustomerNo(Util.null2String(detail.get("customer_no")));
// fileInfo.setCustomerNo("e23deb7a29714d0da5b806665ab3e2f8"); // fileInfo.setCustomerNo("e23deb7a29714d0da5b806665ab3e2f8");
fileInfo.setCustomerNo(Util.null2String(customer)); fileInfo.setCustomerNo(Util.null2String(customer));
if (StringUtils.isNullOrEmpty(fileInfo.getCustomerNo())) { if (StringUtils.isNullOrEmpty(fileInfo.getCustomerNo())) {
@ -391,17 +391,17 @@ public class UploadFile2FaDDAction extends ToolUtil implements Action {
} }
break; break;
case 8: case 8:
// TODO //
// 流程名称 // 流程名称
value = Util.getWorkflowNameById(String.valueOf(dataMap.get("workflowid"))); value = Util.getWorkflowNameById(String.valueOf(dataMap.get("workflowid")));
break; break;
case 9: case 9:
// TODO //
// 请求标题 // 请求标题
value = Util.getRequestTitleById(String.valueOf(dataMap.get("requestid"))); value = Util.getRequestTitleById(String.valueOf(dataMap.get("requestid")));
break; break;
case 10: case 10:
// TODO //
// 流程requestId // 流程requestId
value = dataMap.get("requestid"); value = dataMap.get("requestid");
break; break;

View File

@ -264,7 +264,7 @@ public class FaddContractUtil {
Util.createPrepWhereImpl().whereAnd("workflow_request_id").whereEqual(requestId)); Util.createPrepWhereImpl().whereAnd("workflow_request_id").whereEqual(requestId));
rs.executeUpdate(sqlResult.getSqlStr(), sqlResult.getArgs()); rs.executeUpdate(sqlResult.getSqlStr(), sqlResult.getArgs());
update.clear(); update.clear();
// 更新明细表合同信息 TODO 明细表添加字段signed_status合同方签署状态 // 更新明细表合同信息 明细表添加字段signed_status合同方签署状态
// 签署状态1 已发送待签署2 已签蜀 // 签署状态1 已发送待签署2 已签蜀
update.put("signed_status", 1); update.put("signed_status", 1);
sqlResult = Util.createSqlBuilder().updateSql(tableName, update, sqlResult = Util.createSqlBuilder().updateSql(tableName, update,

View File

@ -94,7 +94,7 @@ public class AddCustomer_Action extends ToolUtil implements Action {
} }
} }
} else { } else {
// TODO 表示根据流程字段判断是插入还是更新 // 表示根据流程字段判断是插入还是更新
String workflowName; String workflowName;
if ("main_table".equals(this.mainResult.getUpdateInsertTable())) { if ("main_table".equals(this.mainResult.getUpdateInsertTable())) {
workflowName = this.tableName; workflowName = this.tableName;
@ -136,14 +136,14 @@ public class AddCustomer_Action extends ToolUtil implements Action {
public void updateCustomerModel(MainResult mainResult, Map<String, List<Map<String, Object>>> configInfoMap, String customerId) { public void updateCustomerModel(MainResult mainResult, Map<String, List<Map<String, Object>>> configInfoMap, String customerId) {
// 1、更新客户基本信息crm_customerinfo // 1、更新客户基本信息crm_customerinfo
if (Utils.conformSql(configInfoMap, "CRM_CustomerInfo")) { if (Utils.conformSql(configInfoMap, "CRM_CustomerInfo")) {
// TODO 将客户基本信息更新 // 将客户基本信息更新
this.updateCustomerInfo(configInfoMap.get("CRM_CustomerInfo"), customerId); this.updateCustomerInfo(configInfoMap.get("CRM_CustomerInfo"), customerId);
} else { } else {
return; return;
} }
// 2、判断更新客户联系信息crm_customercontacter // 2、判断更新客户联系信息crm_customercontacter
if (Utils.conformSql(configInfoMap, "CRM_CustomerContacter") || this.mainResult.getIsOutUser() == 1 || this.mainResult.getIsOutUser() == 0) { if (Utils.conformSql(configInfoMap, "CRM_CustomerContacter") || this.mainResult.getIsOutUser() == 1 || this.mainResult.getIsOutUser() == 0) {
// TODO 将客户联系信息更新到客户联系表中 // 将客户联系信息更新到客户联系表中
if (Utils.conformSql(configInfoMap, "CRM_CustomerContacter")) { if (Utils.conformSql(configInfoMap, "CRM_CustomerContacter")) {
this.updateCustomerContacter(configInfoMap.get("CRM_CustomerContacter"), customerId); this.updateCustomerContacter(configInfoMap.get("CRM_CustomerContacter"), customerId);
} else { } else {
@ -152,31 +152,31 @@ public class AddCustomer_Action extends ToolUtil implements Action {
} }
// 3、判断更新客户地址信息CRM_CustomerAddress // 3、判断更新客户地址信息CRM_CustomerAddress
if (Utils.conformSql(configInfoMap, "CRM_CustomerAddress")) { if (Utils.conformSql(configInfoMap, "CRM_CustomerAddress")) {
// TODO 将客户信息更新到客户地址表中 // 将客户信息更新到客户地址表中
this.updateCustomerAddress(configInfoMap.get("CRM_CustomerAddress"), customerId); this.updateCustomerAddress(configInfoMap.get("CRM_CustomerAddress"), customerId);
} }
// 4、判断更新客户销售商机信息CRM_SellChance // 4、判断更新客户销售商机信息CRM_SellChance
if (Utils.conformSql(configInfoMap, "CRM_SellChance")) { if (Utils.conformSql(configInfoMap, "CRM_SellChance")) {
// TODO 将客户联系信息更新到客户联系表中 // 将客户联系信息更新到客户联系表中
this.updateCustomerSellChance(configInfoMap.get("CRM_SellChance"), customerId); this.updateCustomerSellChance(configInfoMap.get("CRM_SellChance"), customerId);
} }
// 5、判断更新虚拟分部信息hrmsubcompanyvirtual // 5、判断更新虚拟分部信息hrmsubcompanyvirtual
if (Utils.conformSql(configInfoMap, "hrmsubcompanyvirtual") || this.mainResult.getIsOutUser() == 0) { if (Utils.conformSql(configInfoMap, "hrmsubcompanyvirtual") || this.mainResult.getIsOutUser() == 0) {
// TODO 将客户信息更新到虚拟分部信息表中 // 将客户信息更新到虚拟分部信息表中
this.updateHrmsubcompanyvirtual(configInfoMap.get("hrmsubcompanyvirtual"), customerId); this.updateHrmsubcompanyvirtual(configInfoMap.get("hrmsubcompanyvirtual"), customerId);
} else { } else {
return; return;
} }
// 6、判断更新虚拟部门信息hrmdepartmentvirtual // 6、判断更新虚拟部门信息hrmdepartmentvirtual
if (Utils.conformSql(configInfoMap, "hrmdepartmentvirtual") || this.mainResult.getIsOutUser() == 0) { if (Utils.conformSql(configInfoMap, "hrmdepartmentvirtual") || this.mainResult.getIsOutUser() == 0) {
// TODO 见客户信息更新到虚拟部门信息表中 // 见客户信息更新到虚拟部门信息表中
this.updateHrmdepartmentvirtual(configInfoMap.get("hrmdepartmentvirtual"), customerId); this.updateHrmdepartmentvirtual(configInfoMap.get("hrmdepartmentvirtual"), customerId);
} else { } else {
return; return;
} }
// 7、判断更新外部人员信息hrmresource // 7、判断更新外部人员信息hrmresource
if (Utils.conformSql(configInfoMap, "hrmResource") || this.mainResult.getIsOutUser() == 0) { if (Utils.conformSql(configInfoMap, "hrmResource") || this.mainResult.getIsOutUser() == 0) {
// TODO 将客户更新到外部人员信息表中 // 将客户更新到外部人员信息表中
this.updateHrmresource(configInfoMap.get("hrmResource"), customerId); this.updateHrmresource(configInfoMap.get("hrmResource"), customerId);
} }
} }
@ -371,14 +371,14 @@ public class AddCustomer_Action extends ToolUtil implements Action {
Map<String, Object> customer; Map<String, Object> customer;
// 1、插入客户基本信息crm_customerinfo // 1、插入客户基本信息crm_customerinfo
if (Utils.conformSql(configInfoMap, "CRM_CustomerInfo")) { if (Utils.conformSql(configInfoMap, "CRM_CustomerInfo")) {
// TODO 将客户基本信息插入表中 // 将客户基本信息插入表中
customer = this.insertCustomerInfo(configInfoMap.get("CRM_CustomerInfo")); customer = this.insertCustomerInfo(configInfoMap.get("CRM_CustomerInfo"));
} else { } else {
return; return;
} }
// 2、判断插入客户联系信息crm_customercontacter // 2、判断插入客户联系信息crm_customercontacter
if (Utils.conformSql(configInfoMap, "CRM_CustomerContacter") || this.mainResult.getIsOutUser() == 1 || this.mainResult.getIsOutUser() == 0) { if (Utils.conformSql(configInfoMap, "CRM_CustomerContacter") || this.mainResult.getIsOutUser() == 1 || this.mainResult.getIsOutUser() == 0) {
// TODO 将客户联系信息插入到客户联系表中 // 将客户联系信息插入到客户联系表中
if (Utils.conformSql(configInfoMap, "CRM_CustomerContacter")) { if (Utils.conformSql(configInfoMap, "CRM_CustomerContacter")) {
this.insertCustomerContacter(configInfoMap.get("CRM_CustomerContacter"), customer, 0); this.insertCustomerContacter(configInfoMap.get("CRM_CustomerContacter"), customer, 0);
} else { } else {
@ -387,18 +387,18 @@ public class AddCustomer_Action extends ToolUtil implements Action {
} }
// 3、判断插入客户地址信息CRM_CustomerAddress // 3、判断插入客户地址信息CRM_CustomerAddress
if (Utils.conformSql(configInfoMap, "CRM_CustomerAddress")) { if (Utils.conformSql(configInfoMap, "CRM_CustomerAddress")) {
// TODO 将客户信息出入到客户地址表中 // 将客户信息出入到客户地址表中
this.insertCustomerAddress(configInfoMap.get("CRM_CustomerAddress"), customer); this.insertCustomerAddress(configInfoMap.get("CRM_CustomerAddress"), customer);
} }
// 4、判断插入客户销售商机信息CRM_SellChance // 4、判断插入客户销售商机信息CRM_SellChance
if (Utils.conformSql(configInfoMap, "CRM_SellChance")) { if (Utils.conformSql(configInfoMap, "CRM_SellChance")) {
// TODO 将客户联系信息插入到客户联系表中 // 将客户联系信息插入到客户联系表中
this.insertCustomerSellChance(configInfoMap.get("CRM_SellChance"), customer); this.insertCustomerSellChance(configInfoMap.get("CRM_SellChance"), customer);
} }
/*// 5、判断插入虚拟分部信息hrmsubcompanyvirtual /*// 5、判断插入虚拟分部信息hrmsubcompanyvirtual
if (Utils.conformSql(configInfoMap, "hrmsubcompanyvirtual") || this.mainResult.getIsOutUser() == 0) { if (Utils.conformSql(configInfoMap, "hrmsubcompanyvirtual") || this.mainResult.getIsOutUser() == 0) {
// TODO 将客户信息插入到虚拟分部信息表中 // 将客户信息插入到虚拟分部信息表中
this.subId = this.insertHrmsubcompanyvirtual(configInfoMap.get("hrmsubcompanyvirtual"), customer); this.subId = this.insertHrmsubcompanyvirtual(configInfoMap.get("hrmsubcompanyvirtual"), customer);
} else { } else {
return; return;
@ -406,14 +406,14 @@ public class AddCustomer_Action extends ToolUtil implements Action {
// 6、判断插入虚拟部门信息hrmdepartmentvirtual // 6、判断插入虚拟部门信息hrmdepartmentvirtual
if (Utils.conformSql(configInfoMap, "hrmdepartmentvirtual") || this.mainResult.getIsOutUser() == 0) { if (Utils.conformSql(configInfoMap, "hrmdepartmentvirtual") || this.mainResult.getIsOutUser() == 0) {
// TODO 见客户信息插入到虚拟部门信息表中 // 见客户信息插入到虚拟部门信息表中
this.deprtId = this.insertHrmdepartmentvirtual(configInfoMap.get("hrmdepartmentvirtual"), customer, subId); this.deprtId = this.insertHrmdepartmentvirtual(configInfoMap.get("hrmdepartmentvirtual"), customer, subId);
} else { } else {
return; return;
}*/ }*/
// 7、判断插入外部人员信息hrmresource // 7、判断插入外部人员信息hrmresource
if (Utils.conformSql(configInfoMap, "hrmResource") || this.mainResult.getIsOutUser() == 0) { if (Utils.conformSql(configInfoMap, "hrmResource") || this.mainResult.getIsOutUser() == 0) {
// TODO 将客户插入到外部人员信息表中 // 将客户插入到外部人员信息表中
this.insertHrmresource(configInfoMap.get("hrmResource"), customer, subId, deprtId); this.insertHrmresource(configInfoMap.get("hrmResource"), customer, subId, deprtId);
} }
} }
@ -827,7 +827,7 @@ public class AddCustomer_Action extends ToolUtil implements Action {
} }
} }
} }
// TODO 添加必要参数 // 添加必要参数
CityComInfo cityComInfo = new CityComInfo(); CityComInfo cityComInfo = new CityComInfo();
ResourceComInfo resourceComInfo = null; ResourceComInfo resourceComInfo = null;
try { try {
@ -944,7 +944,7 @@ public class AddCustomer_Action extends ToolUtil implements Action {
// 判断客户是否存在通过用户id和客户姓名 // 判断客户是否存在通过用户id和客户姓名
String querySql = "select * from crm_customerInfo where deleted <> 1 and name = ? and manager =?"; String querySql = "select * from crm_customerInfo where deleted <> 1 and name = ? and manager =?";
if (rs.executeQuery(querySql, item.get("name"), finalManagerId) && rs.next()) { if (rs.executeQuery(querySql, item.get("name"), finalManagerId) && rs.next()) {
// TODO 如果客户名重复则特殊处理,如果如果该客户就进行更新 // 如果客户名重复则特殊处理,如果如果该客户就进行更新
customerIdStr.set(rs.getString("id")); customerIdStr.set(rs.getString("id"));
this.updateCustomerInfo(item, customerIdStr.get()); this.updateCustomerInfo(item, customerIdStr.get());
throw new DataExistsException("break now forEach"); throw new DataExistsException("break now forEach");
@ -971,7 +971,7 @@ public class AddCustomer_Action extends ToolUtil implements Action {
this.customerID = customerIdStr.get(); this.customerID = customerIdStr.get();
return cusMap; return cusMap;
} }
// TODO 插入客户基本信息 // 插入客户基本信息
this.insertHandle("CRM_CustomerInfo", mapList); this.insertHandle("CRM_CustomerInfo", mapList);
CustomerInfoComInfo customerInfo = new CustomerInfoComInfo(); CustomerInfoComInfo customerInfo = new CustomerInfoComInfo();
@ -1025,7 +1025,7 @@ public class AddCustomer_Action extends ToolUtil implements Action {
public void insertHandle(String tableName, List<Map<String, Object>> mapList) { public void insertHandle(String tableName, List<Map<String, Object>> mapList) {
RecordSet rs = new RecordSet(); RecordSet rs = new RecordSet();
if (mapList.size() == 1) { if (mapList.size() == 1) {
// TODO 单条数据插入 // 单条数据插入
this.insertHandle(tableName, mapList.get(0)); this.insertHandle(tableName, mapList.get(0));
} else { } else {
mapList.forEach(item -> this.insertHandle(tableName, item)); mapList.forEach(item -> this.insertHandle(tableName, item));
@ -1035,10 +1035,10 @@ public class AddCustomer_Action extends ToolUtil implements Action {
public void insertHandle(String tableName, Map<String, Object> map) { public void insertHandle(String tableName, Map<String, Object> map) {
RecordSet rs = new RecordSet(); RecordSet rs = new RecordSet();
// TODO 单条数据插入 // 单条数据插入
SqlResult sqlResult = BuilderSqlUtil.builderInsertSql(tableName, map); SqlResult sqlResult = BuilderSqlUtil.builderInsertSql(tableName, map);
if (!Objects.isNull(sqlResult)) { if (!Objects.isNull(sqlResult)) {
// TODO 插入数据库数据 // 插入数据库数据
this.writeDebuggerLog(sqlResult.getSqlStr()); this.writeDebuggerLog(sqlResult.getSqlStr());
this.writeDebuggerLog(Arrays.toString(sqlResult.getArgs()) + "\n"); this.writeDebuggerLog(Arrays.toString(sqlResult.getArgs()) + "\n");
rs.executeUpdate(sqlResult.getSqlStr(), sqlResult.getArgs()); rs.executeUpdate(sqlResult.getSqlStr(), sqlResult.getArgs());
@ -1049,7 +1049,7 @@ public class AddCustomer_Action extends ToolUtil implements Action {
RecordSet rs = new RecordSet(); RecordSet rs = new RecordSet();
if (mapList.size() == 1) { if (mapList.size() == 1) {
// TODO 单条数据插入 // 单条数据插入
this.updateHandle(tableName, mapList.get(0), where); this.updateHandle(tableName, mapList.get(0), where);
} else { } else {
mapList.forEach(item -> this.updateHandle(tableName, item, where)); mapList.forEach(item -> this.updateHandle(tableName, item, where));
@ -1059,9 +1059,9 @@ public class AddCustomer_Action extends ToolUtil implements Action {
public void updateHandle(String tableName, Map<String, Object> map, PrepSQLWhere where) { public void updateHandle(String tableName, Map<String, Object> map, PrepSQLWhere where) {
RecordSet rs = new RecordSet(); RecordSet rs = new RecordSet();
// TODO 单条数据插入 // 单条数据插入
SqlResult sqlResult = BuilderSqlUtil.builderUpdateSql(tableName, map, where); SqlResult sqlResult = BuilderSqlUtil.builderUpdateSql(tableName, map, where);
// TODO 插入数据库数据 // 插入数据库数据
// Console.log(sqlResult.getSqlStr()); // Console.log(sqlResult.getSqlStr());
// Console.log(Arrays.toString(sqlResult.getArgs()) + "\n"); // Console.log(Arrays.toString(sqlResult.getArgs()) + "\n");
this.writeDebuggerLog(sqlResult.getSqlStr()); this.writeDebuggerLog(sqlResult.getSqlStr());

View File

@ -346,7 +346,7 @@ public class CRM_Config extends ToolUtil {
sqlMap.put(tableField.getCustomerField().toLowerCase() sqlMap.put(tableField.getCustomerField().toLowerCase()
, value); , value);
}else{ }else{
// TODO bug,外部用户的字段不能出现在客户基本信息里面 // bug,外部用户的字段不能出现在客户基本信息里面
sqlMap.put(tableField.getOutUserField().toLowerCase() sqlMap.put(tableField.getOutUserField().toLowerCase()
, value); , value);
} }