|
|
@@ -7,18 +7,19 @@ import com.tencentcloudapi.essbasic.v20210526.models.FlowDetailInfo;
|
|
|
import common.Controller;
|
|
|
import common.ServiceController;
|
|
|
import common.YosException;
|
|
|
-import common.data.Row;
|
|
|
-import common.data.Rows;
|
|
|
-import common.data.SQLFactory;
|
|
|
-import common.data.UpdateSQL;
|
|
|
+import common.api.YOSAPI;
|
|
|
+import common.data.*;
|
|
|
import common.data.db.DBConnect;
|
|
|
import org.apache.commons.io.FileUtils;
|
|
|
import org.apache.commons.lang.StringUtils;
|
|
|
+import restcontroller.R;
|
|
|
import restcontroller.system.attachment.service.YosServer;
|
|
|
import restcontroller.webmanage.sale.contracttask.WeChatContractUtil;
|
|
|
|
|
|
import java.io.File;
|
|
|
+import java.math.BigDecimal;
|
|
|
import java.net.URL;
|
|
|
+import java.util.UUID;
|
|
|
|
|
|
import static restcontroller.webmanage.sale.contracttask.WeChatConfig.SuperProxyOperatorOpenId;
|
|
|
import static restcontroller.webmanage.sale.contracttask.WeChatContractUtil.describeFlowDetailInfo;
|
|
|
@@ -80,16 +81,17 @@ public class EsignContractTaskService extends ServiceController {
|
|
|
}
|
|
|
//保存签署合同文件并更新归档日期
|
|
|
if (tempStatus.equals("合同签署完成")) {
|
|
|
- Rows rows1 = dbConnect.runSqlQuery("SELECT CONCAT(year,'-',type,'-',name) title from sa_esign_contract_taskmx t1 " +
|
|
|
+ Rows rows1 = dbConnect.runSqlQuery("SELECT CONCAT(year,'-',type,'-',name) title,year from sa_esign_contract_taskmx t1 " +
|
|
|
"INNER JOIN sa_esign_contract_task t2 ON t2.sa_esign_contract_taskid=t1.sa_esign_contract_taskid " +
|
|
|
"INNER JOIN sa_esign_contract_template t3 ON t3.sa_esign_contract_templateid=t2.sa_esign_contract_templateid " +
|
|
|
"WHERE t1.sa_esign_contract_taskmxid=" + sa_esign_contract_taskmxid);
|
|
|
String title = "";
|
|
|
+ Long year = 0L;
|
|
|
if (rows1.isNotEmpty()) {
|
|
|
title = rows1.get(0).getString("title");
|
|
|
+ year = rows1.get(0).getLong("year");
|
|
|
}
|
|
|
|
|
|
-
|
|
|
String downloadurl = WeChatContractUtil.describeFileUrls(flowid);
|
|
|
Rows parameterrows = (new DBConnect()).runSqlQuery("select paramvalue from sys_parameter where paramname='attachment_localhost_path'");
|
|
|
String localhostPath = parameterrows.get(0).getString("paramvalue");
|
|
|
@@ -107,6 +109,70 @@ public class EsignContractTaskService extends ServiceController {
|
|
|
updateSQL.setValue("archiveddate", getDateTime());
|
|
|
updateSQL.update();
|
|
|
logger.info("归档完成");
|
|
|
+ //更新经销商的最新信息
|
|
|
+ //新增任务金额
|
|
|
+
|
|
|
+ Long sa_salestargetbillid = 0L;
|
|
|
+ String sql = "SELECT sa_salestargetbillid FROM sa_salestargetbill WHERE `year` = " + year + " AND targettype ='企业目标' AND siteid = 'MD'";
|
|
|
+ Rows billrows = dbConnect.runSqlQuery(sql);
|
|
|
+ if (billrows.isNotEmpty()) {
|
|
|
+ sa_salestargetbillid = billrows.get(0).getLong("sa_salestargetbillid");
|
|
|
+ } else {
|
|
|
+ sa_salestargetbillid = createTableID("sa_salestargetbill");
|
|
|
+ InsertSQL insertSQL = SQLFactory.createInsertSQL(dbConnect, "sa_salestargetbill");
|
|
|
+ insertSQL.setValue("sa_salestargetbillid", sa_salestargetbillid);
|
|
|
+ insertSQL.setValue("siteid", "MD");
|
|
|
+ insertSQL.setValue("`year`", year);
|
|
|
+ insertSQL.setValue("targettype", "企业目标");
|
|
|
+ insertSQL.setValue("tradefield", "");
|
|
|
+ insertSQL.setValue("assessmentindicators", "出货");
|
|
|
+ insertSQL.setValue("statisticaldimension", "销售出库单审核");
|
|
|
+ insertSQL.setValue("sa_accountclassids", "[]");
|
|
|
+ insertSQL.insert();
|
|
|
+ }
|
|
|
+
|
|
|
+ Long sys_enterpriseid = row.getLong("sys_enterpriseid");
|
|
|
+ Long sa_agentsid = row.getLong("sa_agentsid");
|
|
|
+ BigDecimal s1 = row.getBigDecimal("s1");
|
|
|
+ BigDecimal s2 = row.getBigDecimal("s2");
|
|
|
+ BigDecimal s3 = row.getBigDecimal("s3");
|
|
|
+ BigDecimal s4 = row.getBigDecimal("s4");
|
|
|
+ JSONObject content = new JSONObject();
|
|
|
+ content.put("year", year);
|
|
|
+ content.put("s1l", s1);
|
|
|
+ content.put("s2l", s2);
|
|
|
+ content.put("s3l", s3);
|
|
|
+ content.put("s4l", s4);
|
|
|
+ content.put("sys_enterpriseid", sys_enterpriseid);
|
|
|
+ content.put("sa_salestargetbillid", sa_salestargetbillid);
|
|
|
+
|
|
|
+ YOSAPI.YosRequest yosRequest = new YOSAPI.YosRequest();
|
|
|
+ yosRequest.setRequestKey(UUID.randomUUID().toString());
|
|
|
+ yosRequest.setAccesstoken(getSysController("MD").getAccessToken().getToken());
|
|
|
+ yosRequest.setRequestsessionid("-1");
|
|
|
+ yosRequest.setContent(content);
|
|
|
+ JSONObject resultObject = ((JSONObject) YOSAPI.getApi(R.ID20221229111502.v1.class).action(yosRequest));
|
|
|
+
|
|
|
+// getSysController("MD").callApi(20221229111502L, 1, content);
|
|
|
+ //刷经销商信息
|
|
|
+ updateSQL = SQLFactory.createUpdateSQL(dbConnect, "sa_agents");
|
|
|
+ updateSQL.setWhere("sa_agentsid", sa_agentsid);
|
|
|
+ updateSQL.setWhere("sys_enterpriseid", sys_enterpriseid);
|
|
|
+ updateSQL.setValue("paymans", row.getString("paymans"));
|
|
|
+ updateSQL.setValue("aftersalesphonenumber", row.getString("aftersalesphonenumber"));
|
|
|
+ updateSQL.setValue("presalesphonenumber", row.getString("presalesphonenumber"));
|
|
|
+ updateSQL.update();
|
|
|
+ //刷企业信息
|
|
|
+ updateSQL = SQLFactory.createUpdateSQL(dbConnect, "sys_enterprise");
|
|
|
+ updateSQL.setWhere("sys_enterpriseid", sys_enterpriseid);
|
|
|
+ updateSQL.setValue("idcard", row.getString("idcard"));
|
|
|
+ updateSQL.setValue("taxno", row.getString("taxno"));
|
|
|
+ updateSQL.setValue("phonenumber", row.getString("phonenumber"));
|
|
|
+ updateSQL.setValue("enterprisename", row.getString("license_name"));
|
|
|
+ updateSQL.setValue("address", row.getString("license_address"));
|
|
|
+ updateSQL.setValue("contact", row.getString("legal_rep"));
|
|
|
+ updateSQL.setValue("telephone", row.getString("mobile"));
|
|
|
+ updateSQL.update();
|
|
|
}
|
|
|
}
|
|
|
logger.info("查询腾讯电子签合同状态完成");
|