|
|
@@ -71,6 +71,7 @@ public class EsignContractTaskMX extends Controller {
|
|
|
insertSQL.setValue("license_address", license_address);
|
|
|
insertSQL.setValue("legal_rep", enterpriseRow.getString("contact"));
|
|
|
insertSQL.setValue("mobile", enterpriseRow.getString("telephone"));
|
|
|
+ insertSQL.setValue("idcard", enterpriseRow.getString("idcard"));
|
|
|
insertSQL.setValue("sa_esign_contract_taskid", sa_esign_contract_taskid);
|
|
|
sqlList.add(insertSQL.getSQL());
|
|
|
sqlList.add(DataContrlLog.createLog(this, "sa_esign_contract_task", sa_esign_contract_taskid, "添加", "添加经销商【" + enterprisename + "】成功").getSQL());
|
|
|
@@ -175,19 +176,56 @@ public class EsignContractTaskMX extends Controller {
|
|
|
return getSucReturnObject().toString();
|
|
|
}
|
|
|
|
|
|
+ @API(title = "电子签合同任务明细-修改季度任务金额", apiversion = R.ID2026042113202402.v1.class)
|
|
|
+ public String changeTaskMoney() throws YosException {
|
|
|
+
|
|
|
+ JSONArray sa_esign_contract_taskmxids = content.getJSONArray("sa_esign_contract_taskmxids");
|
|
|
+ BigDecimal s1 = content.getBigDecimal("s1");
|
|
|
+ BigDecimal s2 = content.getBigDecimal("s2");
|
|
|
+ BigDecimal s3 = content.getBigDecimal("s3");
|
|
|
+ BigDecimal s4 = content.getBigDecimal("s4");
|
|
|
+ BigDecimal y1 = s1.add(s2).add(s3).add(s4);
|
|
|
+
|
|
|
+ ArrayList<String> sqlList = new ArrayList<>();
|
|
|
+
|
|
|
+ UpdateSQL updateSQL = SQLFactory.createUpdateSQL(this, "sa_esign_contract_taskmx");
|
|
|
+ updateSQL.setSiteid(siteid);
|
|
|
+ updateSQL.setWhere("sa_esign_contract_taskmxid", sa_esign_contract_taskmxids);
|
|
|
+ updateSQL.setValue("s1", s1);
|
|
|
+ updateSQL.setValue("s2", s2);
|
|
|
+ updateSQL.setValue("s3", s3);
|
|
|
+ updateSQL.setValue("s4", s4);
|
|
|
+ updateSQL.setValue("y1", y1);
|
|
|
+ sqlList.add(updateSQL.getSQL());
|
|
|
+
|
|
|
+ for (Object obj : sa_esign_contract_taskmxids) {
|
|
|
+ Long sa_esign_contract_taskmxid = Long.parseLong(obj.toString());
|
|
|
+ Rows rows = dbConnect.runSqlQuery("SELECT * FROM sa_esign_contract_taskmx WHERE sa_esign_contract_taskmxid=" + sa_esign_contract_taskmxid);
|
|
|
+ if (rows.isNotEmpty()) {
|
|
|
+ Long sa_agentsid = rows.get(0).getLong("sa_agentsid");
|
|
|
+ Long sa_esign_contract_taskid = rows.get(0).getLong("sa_esign_contract_taskid");
|
|
|
+ Rows agentRows = dbConnect.runSqlQuery("SELECT * FROM sv_agents WHERE sa_agentsid=" + sa_agentsid);
|
|
|
+ String enterprisename = agentRows.get(0).getString("enterprisename");
|
|
|
+ sqlList.add(DataContrlLog.createLog(this, "sa_esign_contract_task", sa_esign_contract_taskid, "修改季度任务金额",
|
|
|
+ "修改经销商【" + enterprisename + "】季度任务金为:第一季度(万元):" + s1 + ",第二季度(万元):" + s2 + ",第三季度(万元):" + s3 + ",第四季度(万元):" + s4).getSQL());
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ dbConnect.runSqlUpdate(sqlList);
|
|
|
+
|
|
|
+
|
|
|
+ return getSucReturnObject().toString();
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
@API(title = "电子签合同任务明细-明细列表", apiversion = R.ID2026041315403802.v1.class)
|
|
|
public String list() throws YosException {
|
|
|
|
|
|
Long sa_esign_contract_taskid = content.getLongValue("sa_esign_contract_taskid");
|
|
|
- Long year = 0L;
|
|
|
- Rows taskrows = dbConnect.runSqlQuery("SELECT * FROM sa_esign_contract_task WHERE sa_esign_contract_taskid=" + sa_esign_contract_taskid);
|
|
|
- if (taskrows.isNotEmpty()) {
|
|
|
- year = taskrows.get(0).getLong("year");
|
|
|
- }
|
|
|
|
|
|
QuerySQL querySQL = SQLFactory.createQuerySQL(this, "sa_esign_contract_taskmx",
|
|
|
- "sa_esign_contract_taskmxid", "status", "approvestatus", "license_address", "phonenumber", "legal_rep", "begindate", "enddate", "flowid").setTableAlias("t1");
|
|
|
+ "sa_esign_contract_taskmxid", "status", "approvestatus", "license_address", "phonenumber", "legal_rep", "begindate", "enddate", "flowid",
|
|
|
+ "s1", "s2", "s3", "s4", "y1").setTableAlias("t1");
|
|
|
querySQL.addJoinTable(JOINTYPE.inner, "sa_agents", "t2", "t1.siteid = t2.siteid and t1.sa_agentsid=t2.sa_agentsid",
|
|
|
"sys_enterpriseid", "agentnum");
|
|
|
querySQL.addJoinTable(JOINTYPE.inner, "sys_enterprise", "t3", "t3.siteid = t2.siteid and t3.sys_enterpriseid = t2.sys_enterpriseid",
|
|
|
@@ -199,48 +237,12 @@ public class EsignContractTaskMX extends Controller {
|
|
|
querySQL.setPage(pageSize, pageNumber);
|
|
|
Rows rows = querySQL.query();
|
|
|
|
|
|
- QuerySQL targetQuerySQL = SQLFactory.createQuerySQL(this, "sa_salestarget",
|
|
|
- "sys_enterpriseid", "point", "target_l");
|
|
|
- targetQuerySQL.setWhere("year", year);
|
|
|
- targetQuerySQL.setWhere("type='季'");
|
|
|
- targetQuerySQL.setWhere("sys_enterpriseid", rows.toArrayList("sys_enterpriseid"));
|
|
|
-
|
|
|
- RowsMap targetRowsMap = targetQuerySQL.query().toRowsMap("sys_enterpriseid");
|
|
|
for (Row row : rows) {
|
|
|
- Long sys_enterpriseid = row.getLong("sys_enterpriseid");
|
|
|
- if (targetRowsMap.containsKey(sys_enterpriseid)) {
|
|
|
- Rows targetRows = targetRowsMap.get(sys_enterpriseid);
|
|
|
- BigDecimal y1 = BigDecimal.ZERO;
|
|
|
- for (Row targetRow : targetRows) {
|
|
|
- int point = targetRow.getInteger("point");
|
|
|
- y1 = y1.add(targetRow.getBigDecimal("target_l"));
|
|
|
- switch (point) {
|
|
|
- case 1:
|
|
|
- row.put("s1", targetRow.getBigDecimal("target_l"));
|
|
|
- break;
|
|
|
- case 2:
|
|
|
- row.put("s2", targetRow.getBigDecimal("target_l"));
|
|
|
- break;
|
|
|
- case 3:
|
|
|
- row.put("s3", targetRow.getBigDecimal("target_l"));
|
|
|
- break;
|
|
|
- case 4:
|
|
|
- row.put("s4", targetRow.getBigDecimal("target_l"));
|
|
|
- break;
|
|
|
- }
|
|
|
- row.put("y1", y1);
|
|
|
- }
|
|
|
- }
|
|
|
row.putIfAbsent("s1", 0);
|
|
|
row.putIfAbsent("s2", 0);
|
|
|
row.putIfAbsent("s3", 0);
|
|
|
row.putIfAbsent("s4", 0);
|
|
|
row.putIfAbsent("y1", 0);
|
|
|
- String flowid = row.getString("flowid");
|
|
|
- if (!StringUtils.isBlank(flowid)) {
|
|
|
- row.put("downloadurl", WeChatContractUtil.describeFileUrls(flowid));
|
|
|
- }
|
|
|
- row.putIfAbsent("downloadurl", "");
|
|
|
}
|
|
|
|
|
|
return getSucReturnObject().setData(rows).toString();
|
|
|
@@ -306,16 +308,15 @@ public class EsignContractTaskMX extends Controller {
|
|
|
Row agentRow = ContractTaskUtil.getAgentRow(this, sa_agentsid);
|
|
|
Row enterpriseRow = ContractTaskUtil.getEnterpriseRow(this, sys_enterpriseid);
|
|
|
//校验参数
|
|
|
-// ContractTaskUtil.check(this, agentRow, enterpriseRow, taskmxrow);
|
|
|
+ ContractTaskUtil.check(this, agentRow, enterpriseRow, taskmxrow);
|
|
|
BigDecimal securitydeposit = ContractTaskUtil.getSecurityDeposit(this, sys_enterpriseid);
|
|
|
- BigDecimal taskmoney = ContractTaskUtil.getTaskMoney(this, sys_enterpriseid, year);
|
|
|
|
|
|
String license_name = content.getStringValue("license_name");
|
|
|
String legal_rep = content.getStringValue("legal_rep");
|
|
|
String phonenumber = content.getStringValue("phonenumber");
|
|
|
|
|
|
//构建需要上传的模板传递的数据
|
|
|
- CompanyInfo companyInfo = ContractTaskUtil.getCompanyInfo(this, enterpriseRow, agentRow, taskmxrow, year, securitydeposit, taskmoney);
|
|
|
+ CompanyInfo companyInfo = ContractTaskUtil.getCompanyInfo(this, enterpriseRow, agentRow, taskmxrow, year, securitydeposit);
|
|
|
|
|
|
UpdateSQL updateSQL = SQLFactory.createUpdateSQL(this, "sa_esign_contract_taskmx");
|
|
|
updateSQL.setSiteid(siteid);
|
|
|
@@ -329,6 +330,7 @@ public class EsignContractTaskMX extends Controller {
|
|
|
updateSQL.setValue("presalesphonenumber", content.getStringValue("presalesphonenumber"));
|
|
|
updateSQL.setValue("aftersalesphonenumber", content.getStringValue("aftersalesphonenumber"));
|
|
|
updateSQL.setValue("paymans", content.getStringValue("paymans"));
|
|
|
+ updateSQL.setValue("idcard", content.getStringValue("idcard"));
|
|
|
updateSQL.setValue("companyinfo", JSON.toJSON(companyInfo));
|
|
|
updateSQL.update();
|
|
|
DataContrlLog.createLog(this, "sa_esign_contract_task", sa_esign_contract_taskid, "合同确认", "合同内容确认成功").insert();
|
|
|
@@ -352,7 +354,7 @@ public class EsignContractTaskMX extends Controller {
|
|
|
Rows attachmentRows = Attachment.get(this, "sa_esign_contract_taskmx", sa_esign_contract_taskmxid);
|
|
|
for (Row attachmentRow : attachmentRows) {
|
|
|
Long attachmentid = attachmentRow.getLong("attachmentid");
|
|
|
- InputStream inputStream=getAttachmentFileInputStream(attachmentid);
|
|
|
+ InputStream inputStream = getAttachmentFileInputStream(attachmentid);
|
|
|
String fileBase64 = WeChatContractUtil.convertImageFileToBase64(inputStream);
|
|
|
fileBase64List.add(fileBase64);
|
|
|
}
|