保时捷开发
parent
a66422b667
commit
a45c94e1ee
|
@ -26,6 +26,7 @@ log
|
||||||
/log/
|
/log/
|
||||||
.DS_Store
|
.DS_Store
|
||||||
/src/main/resources/WEB-INF/prop/weaver.properties
|
/src/main/resources/WEB-INF/prop/weaver.properties
|
||||||
|
/src/main/resources/ajzx/
|
||||||
|
|
||||||
/file/
|
/file/
|
||||||
/src/test/resources/application.properties
|
/src/test/resources/application.properties
|
||||||
|
|
|
@ -5,6 +5,8 @@ import aiyh.utils.excention.CustomerException;
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
import weaver.interfaces.schedule.BaseCronJob;
|
import weaver.interfaces.schedule.BaseCronJob;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <h1>基础定时任务模板方法</h1>
|
* <h1>基础定时任务模板方法</h1>
|
||||||
*
|
*
|
||||||
|
@ -41,7 +43,7 @@ public abstract class CusBaseCronJob extends BaseCronJob {
|
||||||
*
|
*
|
||||||
* @author youHong.ai ******************************************
|
* @author youHong.ai ******************************************
|
||||||
*/
|
*/
|
||||||
public abstract void runCode();
|
public abstract void runCode() throws IOException;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -0,0 +1,54 @@
|
||||||
|
package com.api.bokang.xiao.porsche_repush.controller;
|
||||||
|
|
||||||
|
import aiyh.utils.ApiResult;
|
||||||
|
import aiyh.utils.Util;
|
||||||
|
import com.api.bokang.xiao.porsche_repush.service.ContractRePushService;
|
||||||
|
import io.swagger.v3.oas.annotations.parameters.RequestBody;
|
||||||
|
import org.apache.log4j.Logger;
|
||||||
|
import weaver.hrm.HrmUserVarify;
|
||||||
|
import weaver.hrm.User;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import javax.ws.rs.*;
|
||||||
|
import javax.ws.rs.core.Context;
|
||||||
|
import javax.ws.rs.core.MediaType;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ClassName ContractRePushController
|
||||||
|
* @Author 肖博亢
|
||||||
|
* @Date 2023/5/10 10:47
|
||||||
|
* @Description <h1></h1>
|
||||||
|
**/
|
||||||
|
@Path("/xbk/porsche_repush")
|
||||||
|
public class ContractRePushController {
|
||||||
|
|
||||||
|
private final Logger log = Util.getLogger();
|
||||||
|
|
||||||
|
private final ContractRePushService contractRePushService = new ContractRePushService();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <h2>获取流程的总数</h2>
|
||||||
|
* @param request 请求体
|
||||||
|
* @param response 响应体
|
||||||
|
* @param param 请求参数
|
||||||
|
* @return 请求结果
|
||||||
|
*/
|
||||||
|
@Path("/contractRePush")
|
||||||
|
@POST
|
||||||
|
@Produces(MediaType.APPLICATION_JSON)
|
||||||
|
public String contractRePush(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody Map<String,Object> param) {
|
||||||
|
try{
|
||||||
|
log.info("into contractRePush success params ==> "+param);
|
||||||
|
User loginUser = HrmUserVarify.getUser(request, response);
|
||||||
|
List<Map<String,Boolean>> result = contractRePushService.contractRePushService(param,loginUser);
|
||||||
|
return ApiResult.success(result);
|
||||||
|
}catch (Exception e){
|
||||||
|
log.error("contractRePush error ==> "+ Util.getErrString(e));
|
||||||
|
return ApiResult.error(e.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,24 @@
|
||||||
|
package com.api.bokang.xiao.porsche_repush.mapper;
|
||||||
|
|
||||||
|
import aiyh.utils.annotation.recordset.ParamMapper;
|
||||||
|
import aiyh.utils.annotation.recordset.Select;
|
||||||
|
import aiyh.utils.annotation.recordset.SqlMapper;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ClassName QueryMapper
|
||||||
|
* @Author 肖博亢
|
||||||
|
* @Date 2023/5/10 11:00
|
||||||
|
* @Description <h1></h1>
|
||||||
|
**/
|
||||||
|
@SqlMapper
|
||||||
|
public interface QueryMapper {
|
||||||
|
|
||||||
|
@Select("select * from uf_zcht where id in $t{ids}")
|
||||||
|
List<Map<String,Object>> queryContractByIds(@ParamMapper("ids")String ids);
|
||||||
|
|
||||||
|
@Select("select * from actionsettingdetail where ACTIONID = (select id from actionsetting where actionname = #{actionName})")
|
||||||
|
List<Map<String,Object>> queryActionParam(@ParamMapper("actionName")String actionName);
|
||||||
|
}
|
|
@ -0,0 +1,91 @@
|
||||||
|
package com.api.bokang.xiao.porsche_repush.service;
|
||||||
|
|
||||||
|
import aiyh.utils.Util;
|
||||||
|
import aiyh.utils.excention.CustomerException;
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
|
import com.api.bokang.xiao.porsche_repush.mapper.QueryMapper;
|
||||||
|
import org.apache.log4j.Logger;
|
||||||
|
import weaver.aiyh_pcn.common_fadada.action.CommonContractRevocationAction;
|
||||||
|
import weaver.aiyh_pcn.common_fadada.action.CommonCreateContractAction;
|
||||||
|
import weaver.aiyh_pcn.common_fadada.action.CommonOneselfSignAction;
|
||||||
|
import weaver.hrm.User;
|
||||||
|
import weaver.systeminfo.SystemEnv;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ClassName ContractRePushService
|
||||||
|
* @Author 肖博亢
|
||||||
|
* @Date 2023/5/10 10:48
|
||||||
|
* @Description <h1></h1>
|
||||||
|
**/
|
||||||
|
public class ContractRePushService {
|
||||||
|
|
||||||
|
private final Logger log = Util.getLogger();
|
||||||
|
|
||||||
|
private final QueryMapper queryMapper = Util.getMapper(QueryMapper.class);
|
||||||
|
|
||||||
|
public List<Map<String, Boolean>> contractRePushService(Map<String,Object> param, User loginUser) {
|
||||||
|
String ids = Util.null2String(param.get("ids"));
|
||||||
|
int labelId = Util.getIntValue(String.valueOf(param.get("labelId")));
|
||||||
|
String contractCreateAction = Util.null2String(param.get("contractCreateAction"));
|
||||||
|
String signOtherAction = Util.null2String(param.get("signOtherAction"));
|
||||||
|
String contractRevocationAction = Util.null2String(param.get("ContractRevocationAction"));
|
||||||
|
String workflowField = Util.null2String(param.get("workflowField"));
|
||||||
|
List<Map<String, Object>> createList = queryMapper.queryActionParam(contractCreateAction);
|
||||||
|
List<Map<String, Object>> signOtherList = queryMapper.queryActionParam(signOtherAction);
|
||||||
|
List<Map<String, Object>> contractRevocationList = queryMapper.queryActionParam(contractRevocationAction);
|
||||||
|
Map<String, String> contractActionParam = createList.stream().collect(Collectors
|
||||||
|
.toMap(
|
||||||
|
item -> Util.null2String(item.get("attrname")),
|
||||||
|
item -> Util.null2String(item.get("attrvalue"))
|
||||||
|
)
|
||||||
|
);
|
||||||
|
Map<String, String> signOtherActionParam = signOtherList.stream().collect(Collectors
|
||||||
|
.toMap(
|
||||||
|
item -> Util.null2String(item.get("attrname")),
|
||||||
|
item -> Util.null2String(item.get("attrvalue"))
|
||||||
|
)
|
||||||
|
);
|
||||||
|
Map<String, String> contractRevocationParam = contractRevocationList.stream().collect(Collectors
|
||||||
|
.toMap(
|
||||||
|
item -> Util.null2String(item.get("attrname")),
|
||||||
|
item -> Util.null2String(item.get("attrvalue"))
|
||||||
|
)
|
||||||
|
);
|
||||||
|
log.info(String.format("contractCreateAction ==> param:%s signOtherAction ==> param:%s contractRevocationAction ==> param:%s",
|
||||||
|
JSON.toJSONString(contractRevocationParam),
|
||||||
|
JSON.toJSONString(contractActionParam),
|
||||||
|
JSON.toJSONString(signOtherActionParam)
|
||||||
|
));
|
||||||
|
List<Map<String,Object>> contractList = queryMapper.queryContractByIds(ids);
|
||||||
|
List<Map<String, Boolean>> result = new ArrayList<>();
|
||||||
|
for (Map<String, Object> contract : contractList) {
|
||||||
|
String signStatus = Util.null2String(contract.get("zcgsqszt"));
|
||||||
|
if("1".equals(signStatus)){
|
||||||
|
throw new CustomerException(SystemEnv.getHtmlLabelName(labelId, loginUser.getLanguage()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for (Map<String, Object> contract : contractList) {
|
||||||
|
Map<String,Boolean> info = new HashMap<>();
|
||||||
|
int requestId = Util.getIntValue(String.valueOf(contract.get(workflowField)));
|
||||||
|
try{
|
||||||
|
//合同撤回
|
||||||
|
Util.actionTest(CommonContractRevocationAction.class,requestId,contractRevocationParam);
|
||||||
|
//合同创建
|
||||||
|
Util.actionTest(CommonCreateContractAction.class,requestId,contractActionParam);
|
||||||
|
//对方签署
|
||||||
|
Util.actionTest(CommonOneselfSignAction.class,requestId,signOtherActionParam);
|
||||||
|
}catch (CustomerException exception){
|
||||||
|
info.put(String.valueOf(requestId),false);
|
||||||
|
}
|
||||||
|
info.put(String.valueOf(requestId),true);
|
||||||
|
result.add(info);
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,56 @@
|
||||||
|
package com.api.bokang.xiao.zhenn.controller;
|
||||||
|
|
||||||
|
import aiyh.utils.ApiResult;
|
||||||
|
import aiyh.utils.Util;
|
||||||
|
import com.api.bokang.xiao.wx_report.service.ReportService;
|
||||||
|
import com.api.bokang.xiao.wx_report.service.impl.ReportServiceImpl;
|
||||||
|
import com.api.bokang.xiao.zhenn.service.BankService;
|
||||||
|
import io.swagger.v3.oas.annotations.parameters.RequestBody;
|
||||||
|
import org.apache.log4j.Logger;
|
||||||
|
import weaver.hrm.HrmUserVarify;
|
||||||
|
import weaver.hrm.User;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import javax.ws.rs.POST;
|
||||||
|
import javax.ws.rs.Path;
|
||||||
|
import javax.ws.rs.Produces;
|
||||||
|
import javax.ws.rs.core.Context;
|
||||||
|
import javax.ws.rs.core.MediaType;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ClassName ContractController
|
||||||
|
* @Author 肖博亢
|
||||||
|
* @Date 2023/5/8 16:16
|
||||||
|
* @Description <h1></h1>
|
||||||
|
**/
|
||||||
|
@Path("/xbk/zhenn")
|
||||||
|
public class BankController {
|
||||||
|
|
||||||
|
private final Logger log = Util.getLogger();
|
||||||
|
|
||||||
|
private final BankService reportService = new BankService();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <h2>获取搜索组件信息</h2>
|
||||||
|
* @param request 请求体
|
||||||
|
* @param response 响应体
|
||||||
|
* @return 请求结果
|
||||||
|
*/
|
||||||
|
@Path("/getBankData")
|
||||||
|
@POST
|
||||||
|
@Produces(MediaType.APPLICATION_JSON)
|
||||||
|
public String getBankData(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody Map<String,Object> param) {
|
||||||
|
try{
|
||||||
|
log.info("====== into getBankData success =======");
|
||||||
|
log.info("param:"+param);
|
||||||
|
User loginUser = HrmUserVarify.getUser(request, response);
|
||||||
|
Map<String,Object> reportData = reportService.getBankData(loginUser, param);
|
||||||
|
return ApiResult.success(reportData);
|
||||||
|
}catch (Exception e){
|
||||||
|
log.error("getBankData error ==> "+Util.getErrString(e));
|
||||||
|
return ApiResult.error(e.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,10 @@
|
||||||
|
package com.api.bokang.xiao.zhenn.mapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ClassName ContractMapper
|
||||||
|
* @Author 肖博亢
|
||||||
|
* @Date 2023/5/8 16:16
|
||||||
|
* @Description <h1></h1>
|
||||||
|
**/
|
||||||
|
public class BankMapper {
|
||||||
|
}
|
|
@ -0,0 +1,24 @@
|
||||||
|
package com.api.bokang.xiao.zhenn.service;
|
||||||
|
|
||||||
|
import weaver.hrm.User;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ClassName ContractService
|
||||||
|
* @Author 肖博亢
|
||||||
|
* @Date 2023/5/8 16:16
|
||||||
|
* @Description <h1></h1>
|
||||||
|
**/
|
||||||
|
public class BankService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <h2>获取银行数据信息</h2>
|
||||||
|
* @param loginUser 登录信息
|
||||||
|
* @param param 查询参数
|
||||||
|
* @return 银行数据信息
|
||||||
|
*/
|
||||||
|
public Map<String, Object> getBankData(User loginUser, Map<String, Object> param) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
|
@ -38,7 +38,7 @@ public interface ReserveSelectMapper {
|
||||||
* @param param 参数信息
|
* @param param 参数信息
|
||||||
* @return 建模数据
|
* @return 建模数据
|
||||||
*/
|
*/
|
||||||
@Select("select id, $t{applicationNoField}, $t{workflowInfoField}, $t{checkResultField} from $t{modeTableName} where concat(',',concat($t{dateField},',')) like #{datePicker} and ($t{markField} <> 0 or $t{markField} is not null)")
|
@Select("select id, $t{applicationNoField}, $t{workflowInfoField}, $t{checkResultField} from $t{modeTableName} where concat(',',concat($t{dateField},',')) like #{datePicker} and ($t{markField} <> 0 or $t{markField} is null)")
|
||||||
@CaseConversion(value = false)
|
@CaseConversion(value = false)
|
||||||
List<Map<String, Object>> queryModeList(Map<String, Object> param);
|
List<Map<String, Object>> queryModeList(Map<String, Object> param);
|
||||||
|
|
||||||
|
|
|
@ -142,6 +142,7 @@ public class ReserveServiceImpl implements ReserveService {
|
||||||
String workflowInfoField = Util.null2String(param.get("workflowInfoField"));
|
String workflowInfoField = Util.null2String(param.get("workflowInfoField"));
|
||||||
String formId = Util.null2String(param.get("formId"));
|
String formId = Util.null2String(param.get("formId"));
|
||||||
List<Map<String, Object>> modeList = reserveSelectMapper.queryModeList(param);
|
List<Map<String, Object>> modeList = reserveSelectMapper.queryModeList(param);
|
||||||
|
log.info("triggerModeList ==>"+JSON.toJSONString(modeList));
|
||||||
if(Objects.nonNull(modeList) && !modeList.isEmpty()){
|
if(Objects.nonNull(modeList) && !modeList.isEmpty()){
|
||||||
for (Map<String, Object> modeMap : modeList) {
|
for (Map<String, Object> modeMap : modeList) {
|
||||||
Map<String,Object> dealResult = new HashMap<>();
|
Map<String,Object> dealResult = new HashMap<>();
|
||||||
|
|
|
@ -0,0 +1,71 @@
|
||||||
|
package weaver.bokang.xiao.common;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ClassName CommonUtil
|
||||||
|
* @Author 肖博亢
|
||||||
|
* @Date 2023/5/11 20:10
|
||||||
|
* @Description <h1></h1>
|
||||||
|
**/
|
||||||
|
public class CommonUtil {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <h2>获取更新语句</h2>
|
||||||
|
* @param tableName 表名
|
||||||
|
* @param updateParam 更新参数
|
||||||
|
* @param whereParam 条件参数
|
||||||
|
* @return sql语句
|
||||||
|
*/
|
||||||
|
public static String getCusUpdateSql(String tableName, Map<String, Object> updateParam, Map<String, Object> whereParam){
|
||||||
|
return buildUpdateSql(tableName,updateParam) + buildWhereSql(whereParam);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <h2>构建更新sql语句</h2>
|
||||||
|
* @param tableName 表名
|
||||||
|
* @param updateParam 更新参数
|
||||||
|
* @return 更新语句
|
||||||
|
*/
|
||||||
|
public static String buildUpdateSql(String tableName, Map<String, Object> updateParam){
|
||||||
|
StringBuilder updateBuilder = new StringBuilder("update ");
|
||||||
|
updateBuilder.append(tableName).append(" set ");
|
||||||
|
Set<Map.Entry<String, Object>> updateEntries = updateParam.entrySet();
|
||||||
|
for (Map.Entry<String, Object> updateEntry : updateEntries) {
|
||||||
|
if("cusSql".equals(updateEntry.getKey())){
|
||||||
|
updateBuilder.append(updateEntry.getValue());
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
updateBuilder.append(updateEntry.getKey())
|
||||||
|
.append(" = ")
|
||||||
|
.append("#{updateParam.").append(updateEntry.getKey()).append("},");
|
||||||
|
}
|
||||||
|
return updateBuilder.substring(0, updateBuilder.length() - 1) + " ";
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <h2>构建条件sql语句</h2>
|
||||||
|
* @param whereParam 条件参数
|
||||||
|
* @return 条件语句
|
||||||
|
*/
|
||||||
|
public static String buildWhereSql(Map<String, Object> whereParam){
|
||||||
|
StringBuilder whereBuilder = new StringBuilder();
|
||||||
|
Set<Map.Entry<String, Object>> whereEntries = whereParam.entrySet();
|
||||||
|
for (Map.Entry<String, Object> whereEntry : whereEntries) {
|
||||||
|
if("cusSql".equals(whereEntry.getKey())){
|
||||||
|
whereBuilder.append(" and ").append(whereEntry.getValue());
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
whereBuilder.append(" and ")
|
||||||
|
.append(whereEntry.getKey())
|
||||||
|
.append(" = ")
|
||||||
|
.append("#{whereParam.").append(whereEntry.getKey()).append("},");
|
||||||
|
}
|
||||||
|
String fixStr = whereBuilder.toString();
|
||||||
|
if(!"".equals(fixStr)){
|
||||||
|
fixStr = fixStr.replaceFirst(" and "," where ");
|
||||||
|
}
|
||||||
|
return fixStr.substring(0, fixStr.length() - 1) + " ";
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,11 +1,9 @@
|
||||||
package weaver.bokang.xiao.common.mapper;
|
package weaver.bokang.xiao.common.mapper;
|
||||||
|
|
||||||
import aiyh.utils.annotation.recordset.ParamMapper;
|
import aiyh.utils.annotation.recordset.*;
|
||||||
import aiyh.utils.annotation.recordset.Select;
|
|
||||||
import aiyh.utils.annotation.recordset.SqlMapper;
|
|
||||||
import aiyh.utils.annotation.recordset.Update;
|
|
||||||
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @ClassName WorkflowMapper
|
* @ClassName WorkflowMapper
|
||||||
|
@ -38,4 +36,15 @@ public interface WorkflowMapper {
|
||||||
@ParamMapper("fieldName") String fieldName,
|
@ParamMapper("fieldName") String fieldName,
|
||||||
@ParamMapper("fieldValue") String fieldValue,
|
@ParamMapper("fieldValue") String fieldValue,
|
||||||
@ParamMapper("requestId") String requestId);
|
@ParamMapper("requestId") String requestId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <h2>执行自定义更新sql</h2>
|
||||||
|
* @param cusSql 自定义sql
|
||||||
|
* @param updateParam 更新参数信息
|
||||||
|
* @param whereParam 条件参数信息
|
||||||
|
* @return 查询结果
|
||||||
|
*/
|
||||||
|
@Update(custom = true)
|
||||||
|
boolean executeUpdateCusSql(@SqlString String cusSql, @ParamMapper("updateParam")Map<String,Object> updateParam, @ParamMapper("whereParam")Map<String,Object> whereParam);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,38 @@
|
||||||
|
package weaver.bokang.xiao.common.model_update.entity;
|
||||||
|
|
||||||
|
import aiyh.utils.annotation.recordset.SqlOracleDbFieldAnn;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ClassName AssignmentEntity
|
||||||
|
* @Author 肖博亢
|
||||||
|
* @Date 2023/4/4 15:42
|
||||||
|
* @Description <h1></h1>
|
||||||
|
**/
|
||||||
|
@Data
|
||||||
|
public class AssignmentEntity {
|
||||||
|
|
||||||
|
/** 赋值字段 */
|
||||||
|
@SqlOracleDbFieldAnn("ASSIGNMENT_FIELD")
|
||||||
|
private String assignmentField;
|
||||||
|
|
||||||
|
/** 值选择 */
|
||||||
|
@SqlOracleDbFieldAnn("VALUE_SELECT")
|
||||||
|
private Integer valueSelect;
|
||||||
|
|
||||||
|
/** 源字段 */
|
||||||
|
@SqlOracleDbFieldAnn("SOURCE_FIELD")
|
||||||
|
private String sourceField;
|
||||||
|
|
||||||
|
/** 赋值字段名 */
|
||||||
|
@SqlOracleDbFieldAnn("ASSIGNMENT_FIELD_NAME")
|
||||||
|
private String assignmentFieldName;
|
||||||
|
|
||||||
|
/** 源字段名 */
|
||||||
|
@SqlOracleDbFieldAnn("SOURCE_FIELD_NAME")
|
||||||
|
private String sourceFieldName;
|
||||||
|
|
||||||
|
/** 文本框 */
|
||||||
|
@SqlOracleDbFieldAnn("CUS_CONTEXT")
|
||||||
|
private String cusContext;
|
||||||
|
}
|
|
@ -0,0 +1,46 @@
|
||||||
|
package weaver.bokang.xiao.common.model_update.entity;
|
||||||
|
|
||||||
|
import aiyh.utils.annotation.recordset.SqlOracleDbFieldAnn;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ClassName ConditionEntity
|
||||||
|
* @Author 肖博亢
|
||||||
|
* @Date 2023/4/4 15:39
|
||||||
|
* @Description <h1></h1>
|
||||||
|
**/
|
||||||
|
@Data
|
||||||
|
public class ConditionEntity {
|
||||||
|
|
||||||
|
/** 条件类型 */
|
||||||
|
@SqlOracleDbFieldAnn("CONDITION_TYPE")
|
||||||
|
private Integer conditionType;
|
||||||
|
|
||||||
|
/** 条件 */
|
||||||
|
@SqlOracleDbFieldAnn("CONDITION_VALUE")
|
||||||
|
private Integer conditionValue;
|
||||||
|
|
||||||
|
/** 源字段 */
|
||||||
|
@SqlOracleDbFieldAnn("CONDITION_SOURCE_FIELD")
|
||||||
|
private String conditionSourceField;
|
||||||
|
|
||||||
|
/** 值类型 */
|
||||||
|
@SqlOracleDbFieldAnn("VALUE_TYPE")
|
||||||
|
private Integer valueType;
|
||||||
|
|
||||||
|
/** 目标字段 */
|
||||||
|
@SqlOracleDbFieldAnn("CONDITION_TARGET_FIELD")
|
||||||
|
private String conditionTargetField;
|
||||||
|
|
||||||
|
/** 源字段名 */
|
||||||
|
@SqlOracleDbFieldAnn("CONDITION_SOURCE_FIELD_NAME")
|
||||||
|
private String conditionSourceFieldName;
|
||||||
|
|
||||||
|
/** 目标字段名 */
|
||||||
|
@SqlOracleDbFieldAnn("CONDITION_TARGET_FIELD_NAME")
|
||||||
|
private String conditionTargetFieldName;
|
||||||
|
|
||||||
|
/** 文本框 */
|
||||||
|
@SqlOracleDbFieldAnn("CUS_TEXT")
|
||||||
|
private String cusText;
|
||||||
|
}
|
|
@ -0,0 +1,59 @@
|
||||||
|
package weaver.bokang.xiao.common.model_update.entity;
|
||||||
|
|
||||||
|
import aiyh.utils.annotation.recordset.SqlOracleDbFieldAnn;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ClassName UpdateModeConf
|
||||||
|
* @Author 肖博亢
|
||||||
|
* @Date 2023/4/4 15:32
|
||||||
|
* @Description <h1></h1>
|
||||||
|
**/
|
||||||
|
@Data
|
||||||
|
public class UpdateModeConf {
|
||||||
|
|
||||||
|
/** 源建模 */
|
||||||
|
@SqlOracleDbFieldAnn("SOURCE_MODE")
|
||||||
|
private String sourceMode;
|
||||||
|
|
||||||
|
/** 触发建模 */
|
||||||
|
@SqlOracleDbFieldAnn("TARGET_MODE")
|
||||||
|
private String targetMode;
|
||||||
|
|
||||||
|
/** 说明 */
|
||||||
|
@SqlOracleDbFieldAnn("DESCRIPTION")
|
||||||
|
private String description;
|
||||||
|
|
||||||
|
/** 唯一标识 */
|
||||||
|
@SqlOracleDbFieldAnn("UNIQUE_CODE")
|
||||||
|
private String uniqueCode;
|
||||||
|
|
||||||
|
/** 源表名 */
|
||||||
|
@SqlOracleDbFieldAnn("SOURCE_TABLE_NAME")
|
||||||
|
private String sourceTableName;
|
||||||
|
|
||||||
|
/** 触发表名 */
|
||||||
|
@SqlOracleDbFieldAnn("TARGET_TABLE_NAME")
|
||||||
|
private String targetTableName;
|
||||||
|
|
||||||
|
/** 数据写入方式 */
|
||||||
|
@SqlOracleDbFieldAnn("DATA_IN_TYPE")
|
||||||
|
private Integer dataInType;
|
||||||
|
|
||||||
|
/** 自定义操作类全路径 */
|
||||||
|
@SqlOracleDbFieldAnn("OPERATE_PATH")
|
||||||
|
private String operatePath;
|
||||||
|
|
||||||
|
/** 无条件触发 */
|
||||||
|
@SqlOracleDbFieldAnn("NO_RULE")
|
||||||
|
private Integer noRule;
|
||||||
|
|
||||||
|
/** 条件列表 */
|
||||||
|
private List<ConditionEntity> conditionList;
|
||||||
|
|
||||||
|
/** 赋值列表 */
|
||||||
|
private List<AssignmentEntity> assignmentList;
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,20 @@
|
||||||
|
package weaver.bokang.xiao.common.model_update.function;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ClassName ConditionFunction
|
||||||
|
* @Author 肖博亢
|
||||||
|
* @Date 2023/4/4 17:58
|
||||||
|
* @Description <h1></h1>
|
||||||
|
**/
|
||||||
|
@FunctionalInterface
|
||||||
|
public interface ConditionFunction <R,P,Q,K>{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <h2>条件处理</h2>
|
||||||
|
* @param p 参数
|
||||||
|
* @param q 参数
|
||||||
|
* @param k 参数
|
||||||
|
* @return 返回值
|
||||||
|
*/
|
||||||
|
R apply(P p,Q q,K k);
|
||||||
|
}
|
|
@ -0,0 +1,36 @@
|
||||||
|
package weaver.bokang.xiao.common.model_update.function;
|
||||||
|
|
||||||
|
import aiyh.utils.Util;
|
||||||
|
import org.apache.log4j.Logger;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ClassName CusOperateInterface
|
||||||
|
* @Author 肖博亢
|
||||||
|
* @Date 2023/4/7 14:52
|
||||||
|
* @Description <h1></h1>
|
||||||
|
**/
|
||||||
|
public interface CusOperateInterface {
|
||||||
|
|
||||||
|
Logger logger = Util.getLogger();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <h2>自定义接口操作<h2/>
|
||||||
|
*
|
||||||
|
* <p>
|
||||||
|
* whereParam: 条件参数信息 key为数据库字段名,值为条件值
|
||||||
|
* param{
|
||||||
|
* tableName:"更新数据表名",
|
||||||
|
* whereSql:"条件sql",
|
||||||
|
* operatePath:"接口全路径类名"
|
||||||
|
* }
|
||||||
|
* pathParam: 路径参数
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @param whereParam 条件参数信息
|
||||||
|
* @param param 基本参数
|
||||||
|
* @param pathParam 路径参数
|
||||||
|
*/
|
||||||
|
void execute(Map<String,Object> whereParam, Map<String,String> param,Map<String,String> pathParam);
|
||||||
|
}
|
|
@ -0,0 +1,108 @@
|
||||||
|
package weaver.bokang.xiao.common.model_update.mapper;
|
||||||
|
|
||||||
|
import aiyh.utils.annotation.recordset.*;
|
||||||
|
import weaver.bokang.xiao.common.model_update.entity.AssignmentEntity;
|
||||||
|
import weaver.bokang.xiao.common.model_update.entity.ConditionEntity;
|
||||||
|
import weaver.bokang.xiao.common.model_update.entity.UpdateModeConf;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ClassName UpdateModeMapper
|
||||||
|
* @Author 肖博亢
|
||||||
|
* @Date 2023/4/4 15:47
|
||||||
|
* @Description <h1></h1>
|
||||||
|
**/
|
||||||
|
@SqlMapper
|
||||||
|
public interface UpdateModeMapper {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <h2>通过formId查询相关配置信息</h2>
|
||||||
|
* @param formId 表单id
|
||||||
|
* @return 配置列表
|
||||||
|
*/
|
||||||
|
@Select("select * from uf_update_mode_conf where source_mode = #{formId}")
|
||||||
|
@CollectionMappings({
|
||||||
|
@CollectionMapping(property = "conditionList", column = "id", id = @Id(value = Integer.class, methodId = 1)),
|
||||||
|
@CollectionMapping(property = "assignmentList", column = "id", id = @Id(value = Integer.class, methodId = 2)),
|
||||||
|
})
|
||||||
|
List<UpdateModeConf> queryUpdateModeConfByFormId(@ParamMapper("formId")String formId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <h2>通过formId查询相关配置信息</h2>
|
||||||
|
* @return 配置列表
|
||||||
|
*/
|
||||||
|
@Select("select * from uf_update_mode_conf")
|
||||||
|
@CollectionMappings({
|
||||||
|
@CollectionMapping(property = "conditionList", column = "id", id = @Id(value = Integer.class, methodId = 1)),
|
||||||
|
@CollectionMapping(property = "assignmentList", column = "id", id = @Id(value = Integer.class, methodId = 2)),
|
||||||
|
})
|
||||||
|
List<UpdateModeConf> queryUpdateModeConf();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <h2>查询条件列表</h2>
|
||||||
|
* @param mainId 主数据id
|
||||||
|
* @return 条件列表
|
||||||
|
*/
|
||||||
|
@Select("select * from uf_update_mode_conf_dt1 where mainid = #{mainId}")
|
||||||
|
@CollectionMethod(1)
|
||||||
|
List<ConditionEntity> queryConditionList(@ParamMapper("mainId")int mainId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <h2>查询赋值列表</h2>
|
||||||
|
* @param mainId 主数据id
|
||||||
|
* @return 赋值列表
|
||||||
|
*/
|
||||||
|
@Select("select * from uf_update_mode_conf_dt2 where mainid = #{mainId}")
|
||||||
|
@CollectionMethod(2)
|
||||||
|
List<AssignmentEntity> queryAssignmentList(@ParamMapper("mainId")int mainId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <h2>执行自定义查询sql</h2>
|
||||||
|
* @param cusSql 自定义sql
|
||||||
|
* @param param 参数信息
|
||||||
|
* @param cusParam 参数信息
|
||||||
|
* @return 查询结果
|
||||||
|
*/
|
||||||
|
@Select(custom = true)
|
||||||
|
String executeCusSql(@SqlString String cusSql, @ParamMapper("param")Map<String,Object> param,Map<String,Object> cusParam);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <h2>执行自定义查询sql</h2>
|
||||||
|
* @param cusSql 自定义sql
|
||||||
|
* @param whereParam 参数信息
|
||||||
|
* @param cusParam 参数信息
|
||||||
|
* @return 查询结果
|
||||||
|
*/
|
||||||
|
@Select(custom = true)
|
||||||
|
Map<String,Object> executeCusSqlMap(@SqlString String cusSql,
|
||||||
|
@ParamMapper("whereParam")Map<String,Object> whereParam,
|
||||||
|
@ParamMapper("cusParam")Map<String,Object> cusParam);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <h2>执行自定义查询sql</h2>
|
||||||
|
* @param cusSql 自定义sql
|
||||||
|
* @param whereParam 参数信息
|
||||||
|
* @param cusParam 参数信息
|
||||||
|
* @return 查询结果
|
||||||
|
*/
|
||||||
|
@Select(custom = true)
|
||||||
|
List<Map<String,Object>> executeCusSqlList(@SqlString String cusSql,
|
||||||
|
@ParamMapper("whereParam")Map<String,Object> whereParam,
|
||||||
|
@ParamMapper("cusParam")Map<String,Object> cusParam);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <h2>执行自定义更新sql</h2>
|
||||||
|
* @param cusSql 自定义sql
|
||||||
|
* @param updateParam 更新参数信息
|
||||||
|
* @param whereParam 条件参数信息
|
||||||
|
* @return 查询结果
|
||||||
|
*/
|
||||||
|
@Update(custom = true)
|
||||||
|
boolean executeUpdateCusSql(@SqlString String cusSql,
|
||||||
|
@ParamMapper("updateParam")Map<String,Object> updateParam,
|
||||||
|
@ParamMapper("whereParam")Map<String,Object> whereParam);
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,131 @@
|
||||||
|
package weaver.bokang.xiao.common.model_update.process;
|
||||||
|
|
||||||
|
import aiyh.utils.Util;
|
||||||
|
import aiyh.utils.annotation.MethodRuleNo;
|
||||||
|
import org.apache.log4j.Logger;
|
||||||
|
import weaver.bokang.xiao.common.model_update.function.ConditionFunction;
|
||||||
|
|
||||||
|
import java.lang.reflect.InvocationTargetException;
|
||||||
|
import java.lang.reflect.Method;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ClassName ConditionTargetProcess
|
||||||
|
* @Author 肖博亢
|
||||||
|
* @Date 2023/4/4 17:54
|
||||||
|
* @Description <h1>目标建模条件sql生成处理</h1>
|
||||||
|
**/
|
||||||
|
public class ConditionTargetProcess {
|
||||||
|
|
||||||
|
public static final Map<Integer, ConditionFunction<String,Map<String,Object>,Map<String,Object>,String>> TARGET_MODE_METHOD_MAP = new HashMap<>();
|
||||||
|
|
||||||
|
public static final Logger logger = Util.getLogger();
|
||||||
|
|
||||||
|
static {
|
||||||
|
try {
|
||||||
|
Class<ConditionTargetProcess> valueRuleMethodClass = ConditionTargetProcess.class;
|
||||||
|
Method[] methods = valueRuleMethodClass.getDeclaredMethods();
|
||||||
|
for (Method method : methods) {
|
||||||
|
if (method.isAnnotationPresent(MethodRuleNo.class)) {
|
||||||
|
MethodRuleNo annotation = method.getAnnotation(MethodRuleNo.class);
|
||||||
|
int value = annotation.value();
|
||||||
|
TARGET_MODE_METHOD_MAP.put(value, (whereParam,param,whereSql) -> {
|
||||||
|
try {
|
||||||
|
return (String) method.invoke(null,whereParam,param,whereSql);
|
||||||
|
} catch (IllegalAccessException | InvocationTargetException e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}catch (Exception exception){
|
||||||
|
logger.error("ConditionTargetProcess init error !!! "+Util.getErrString(exception));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <h2>目标建模等于处理方法</h2>
|
||||||
|
* @param whereParam 条件参数
|
||||||
|
* @param param 参数信息
|
||||||
|
* @param whereSql 条件sql
|
||||||
|
* @return 条件sql
|
||||||
|
*/
|
||||||
|
@MethodRuleNo(value = 0, desc = "等于")
|
||||||
|
public static String equals(Map<String,Object> whereParam,Map<String,Object> param,String whereSql) {
|
||||||
|
String conditionValue = Util.null2String(param.get("conditionValue"));
|
||||||
|
String targetFieldName = Util.null2String(param.get("targetFieldName"));
|
||||||
|
String targetStr = " and "+targetFieldName+" = #{whereParam."+targetFieldName+"}";
|
||||||
|
whereSql += targetStr;
|
||||||
|
whereParam.put(targetFieldName,conditionValue);
|
||||||
|
return whereSql;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <h2>目标建模不等于处理方法</h2>
|
||||||
|
* @param whereParam 条件参数
|
||||||
|
* @param param 参数信息
|
||||||
|
* @param whereSql 条件sql
|
||||||
|
* @return 条件sql
|
||||||
|
*/
|
||||||
|
@MethodRuleNo(value = 1, desc = "不等于")
|
||||||
|
public static String noEquals(Map<String,Object> whereParam,Map<String,Object> param,String whereSql) {
|
||||||
|
String conditionValue = Util.null2String(param.get("conditionValue"));
|
||||||
|
String targetFieldName = Util.null2String(param.get("targetFieldName"));
|
||||||
|
String targetStr = " and "+targetFieldName+" <> #{whereParam."+targetFieldName+"}";
|
||||||
|
whereSql += targetStr;
|
||||||
|
whereParam.put(targetFieldName,conditionValue);
|
||||||
|
return whereSql;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <h2>目标建模不等于处理方法</h2>
|
||||||
|
* @param whereParam 条件参数
|
||||||
|
* @param param 参数信息
|
||||||
|
* @param whereSql 条件sql
|
||||||
|
* @return 条件sql
|
||||||
|
*/
|
||||||
|
@MethodRuleNo(value = 6, desc = "in")
|
||||||
|
public static String in(Map<String,Object> whereParam,Map<String,Object> param,String whereSql) {
|
||||||
|
String conditionValue = Util.null2String(param.get("conditionValue"));
|
||||||
|
String targetFieldName = Util.null2String(param.get("targetFieldName"));
|
||||||
|
String targetStr = " and "+targetFieldName+" in ( $t{whereParam."+targetFieldName+"})";
|
||||||
|
whereSql += targetStr;
|
||||||
|
whereParam.put(targetFieldName,conditionValue);
|
||||||
|
return whereSql;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <h2>目标建模不等于处理方法</h2>
|
||||||
|
* @param whereParam 条件参数
|
||||||
|
* @param param 参数信息
|
||||||
|
* @param whereSql 条件sql
|
||||||
|
* @return 条件sql
|
||||||
|
*/
|
||||||
|
@MethodRuleNo(value = 7, desc = "not in")
|
||||||
|
public static String notIn(Map<String,Object> whereParam,Map<String,Object> param,String whereSql) {
|
||||||
|
String conditionValue = Util.null2String(param.get("conditionValue"));
|
||||||
|
String targetFieldName = Util.null2String(param.get("targetFieldName"));
|
||||||
|
String targetStr = " and "+targetFieldName+" not in ( $t{whereParam."+targetFieldName+"})";
|
||||||
|
whereSql += targetStr;
|
||||||
|
whereParam.put(targetFieldName,conditionValue);
|
||||||
|
return whereSql;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <h2>目标建模不等于处理方法</h2>
|
||||||
|
* @param whereParam 条件参数
|
||||||
|
* @param param 参数信息
|
||||||
|
* @param whereSql 条件sql
|
||||||
|
* @return 条件sql
|
||||||
|
*/
|
||||||
|
@MethodRuleNo(value = 8, desc = "自定义sql")
|
||||||
|
public static String cusSql(Map<String,Object> whereParam,Map<String,Object> param,String whereSql) {
|
||||||
|
String conditionValue = Util.null2String(param.get("conditionValue"));
|
||||||
|
String targetStr = " and "+Util.sbc2dbcCase(conditionValue);
|
||||||
|
whereSql += targetStr;
|
||||||
|
return whereSql;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,98 @@
|
||||||
|
package weaver.bokang.xiao.common.model_update.process;
|
||||||
|
|
||||||
|
import aiyh.utils.Util;
|
||||||
|
import aiyh.utils.annotation.MethodRuleNo;
|
||||||
|
import org.apache.log4j.Logger;
|
||||||
|
|
||||||
|
import java.lang.reflect.InvocationTargetException;
|
||||||
|
import java.lang.reflect.Method;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.function.BiFunction;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ClassName ConditionValueProcess
|
||||||
|
* @Author 肖博亢
|
||||||
|
* @Date 2023/4/4 16:19
|
||||||
|
* @Description <h1>源建模数据判读条件相关处理</h1>
|
||||||
|
**/
|
||||||
|
public class ConditionValueProcess {
|
||||||
|
|
||||||
|
public static final Map<Integer, BiFunction<String,String, Boolean>> SOURCE_MODE_METHOD_MAP = new HashMap<>();
|
||||||
|
|
||||||
|
|
||||||
|
public static final Logger logger = Util.getLogger();
|
||||||
|
|
||||||
|
static {
|
||||||
|
try {
|
||||||
|
Class<ConditionValueProcess> valueRuleMethodClass = ConditionValueProcess.class;
|
||||||
|
Method[] methods = valueRuleMethodClass.getDeclaredMethods();
|
||||||
|
for (Method method : methods) {
|
||||||
|
if (method.isAnnotationPresent(MethodRuleNo.class)) {
|
||||||
|
MethodRuleNo annotation = method.getAnnotation(MethodRuleNo.class);
|
||||||
|
int value = annotation.value();
|
||||||
|
SOURCE_MODE_METHOD_MAP.put(value, (sourceValue, conditionValue) -> {
|
||||||
|
try {
|
||||||
|
return (Boolean) method.invoke(null,sourceValue, conditionValue);
|
||||||
|
} catch (IllegalAccessException | InvocationTargetException e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}catch (Exception exception){
|
||||||
|
logger.error("ConditionValueProcess init error !!! "+Util.getErrString(exception));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <h2>源建模等于处理方法</h2>
|
||||||
|
* @param sourceValue 源建模值
|
||||||
|
* @param value 目标值
|
||||||
|
* @return 是否符合
|
||||||
|
*/
|
||||||
|
@MethodRuleNo(value = 0, desc = "等于")
|
||||||
|
public static boolean equals(String sourceValue, String value) {
|
||||||
|
return sourceValue.equals(value);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <h2>源建模不等于处理方法</h2>
|
||||||
|
* @param sourceValue 源建模值
|
||||||
|
* @param value 目标值
|
||||||
|
* @return 是否符合
|
||||||
|
*/
|
||||||
|
@MethodRuleNo(value = 1, desc = "不等于")
|
||||||
|
public static boolean noEquals(String sourceValue, String value) {
|
||||||
|
return !sourceValue.equals(value);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <h2>源建模不等于处理方法</h2>
|
||||||
|
* @param sourceValue 源建模值
|
||||||
|
* @param value 目标值
|
||||||
|
* @return 是否符合
|
||||||
|
*/
|
||||||
|
@MethodRuleNo(value = 6, desc = "in")
|
||||||
|
public static boolean in(String sourceValue, String value) {
|
||||||
|
if("".equals(sourceValue) || "".equals(value)){
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
String tempStr = ","+value+",";
|
||||||
|
sourceValue = "," + sourceValue + ",";
|
||||||
|
return tempStr.contains(sourceValue);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <h2>源建模不等于处理方法</h2>
|
||||||
|
* @param sourceValue 源建模值
|
||||||
|
* @param value 目标值
|
||||||
|
* @return 是否符合
|
||||||
|
*/
|
||||||
|
@MethodRuleNo(value = 7, desc = "not in")
|
||||||
|
public static boolean notIn(String sourceValue, String value) {
|
||||||
|
return !in(sourceValue, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,253 @@
|
||||||
|
package weaver.bokang.xiao.common.model_update.process;
|
||||||
|
|
||||||
|
import aiyh.utils.Util;
|
||||||
|
import aiyh.utils.annotation.MethodRuleNo;
|
||||||
|
import aiyh.utils.excention.CustomerException;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.apache.log4j.Logger;
|
||||||
|
import weaver.bokang.xiao.common.model_update.function.ConditionFunction;
|
||||||
|
import weaver.bokang.xiao.common.model_update.function.CusOperateInterface;
|
||||||
|
import weaver.bokang.xiao.common.model_update.mapper.UpdateModeMapper;
|
||||||
|
|
||||||
|
import java.lang.reflect.Constructor;
|
||||||
|
import java.lang.reflect.InvocationTargetException;
|
||||||
|
import java.lang.reflect.Method;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ClassName DataTypeProcess
|
||||||
|
* @Author 肖博亢
|
||||||
|
* @Date 2023/4/6 13:10
|
||||||
|
* @Description <h1>建模数据更新处理</h1>
|
||||||
|
**/
|
||||||
|
public class DataTypeProcess {
|
||||||
|
|
||||||
|
public static final Map<Integer, ConditionFunction<Boolean,Map<String,Object>,Map<String,Object>, Map<String,String>>> SOURCE_MODE_METHOD_MAP = new HashMap<>();
|
||||||
|
|
||||||
|
private static final UpdateModeMapper UPDATE_MODE_MAPPER = Util.getMapper(UpdateModeMapper.class);
|
||||||
|
|
||||||
|
public static final Logger logger = Util.getLogger();
|
||||||
|
|
||||||
|
static {
|
||||||
|
try {
|
||||||
|
Class<DataTypeProcess> valueRuleMethodClass = DataTypeProcess.class;
|
||||||
|
Method[] methods = valueRuleMethodClass.getDeclaredMethods();
|
||||||
|
for (Method method : methods) {
|
||||||
|
if (method.isAnnotationPresent(MethodRuleNo.class)) {
|
||||||
|
MethodRuleNo annotation = method.getAnnotation(MethodRuleNo.class);
|
||||||
|
int value = annotation.value();
|
||||||
|
SOURCE_MODE_METHOD_MAP.put(value, (updateParam, whereParam,param) -> {
|
||||||
|
try {
|
||||||
|
return (boolean) method.invoke(null,updateParam, whereParam,param);
|
||||||
|
} catch (IllegalAccessException | InvocationTargetException e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}catch (Exception exception){
|
||||||
|
logger.error("DataTypeProcess init error !!! "+Util.getErrString(exception));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <h2>更新处理方法</h2>
|
||||||
|
* @param updateParam 更新参数
|
||||||
|
* @param whereParam 条件参数
|
||||||
|
* @param param 表参数
|
||||||
|
* @return 更新字符串
|
||||||
|
*/
|
||||||
|
@MethodRuleNo(value = 0, desc = "更新")
|
||||||
|
public static boolean update(Map<String,Object> updateParam, Map<String,Object> whereParam,Map<String,String> param) {
|
||||||
|
String tableName = Util.null2String(param.get("tableName"));
|
||||||
|
String whereSql = Util.null2String(param.get("whereSql"));
|
||||||
|
String updateSql = DataTypeProcess.buildUpdateSql(tableName, updateParam);
|
||||||
|
if(!"".equals(whereSql)){
|
||||||
|
whereSql = whereSql.replaceFirst(" and "," where ");
|
||||||
|
}
|
||||||
|
updateSql = updateSql + whereSql;
|
||||||
|
logger.info(String.format("updateSql ==> %s updateParam ==> %s whereParam ==> %s",updateSql,updateParam,whereParam));
|
||||||
|
return UPDATE_MODE_MAPPER.executeUpdateCusSql(updateSql, updateParam, whereParam);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <h2>插入处理方法</h2>
|
||||||
|
* @param updateParam 更新参数
|
||||||
|
* @param whereParam 条件参数
|
||||||
|
* @param param 表参数
|
||||||
|
* @return 更新字符串
|
||||||
|
*/
|
||||||
|
@MethodRuleNo(value = 1, desc = "插入")
|
||||||
|
public static boolean insert(Map<String,Object> updateParam, Map<String,Object> whereParam,Map<String,String> param) {
|
||||||
|
String tableName = Util.null2String(param.get("tableName"));
|
||||||
|
String modeId = Util.getModeIdByTableName(tableName);
|
||||||
|
int dataId = Util.getModeDataId(tableName, Util.getIntValue(modeId), 1);
|
||||||
|
whereParam.clear();
|
||||||
|
whereParam.put("id",dataId);
|
||||||
|
String updateSql = buildUpdateSql(tableName, updateParam);
|
||||||
|
String whereSql = DataTypeProcess.buildWhereSql(whereParam);
|
||||||
|
updateSql = updateSql + " " + whereSql;
|
||||||
|
logger.info(String.format("updateSql ==> %s updateParam ==> %s whereParam ==> %s",updateSql,updateParam,whereParam));
|
||||||
|
return UPDATE_MODE_MAPPER.executeUpdateCusSql(updateSql,updateParam,whereParam);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <h2>执行自定义处理方法</h2>
|
||||||
|
* @param updateParam 更新参数
|
||||||
|
* @param whereParam 条件参数
|
||||||
|
* @param param 表参数
|
||||||
|
* @return 执行结果
|
||||||
|
*/
|
||||||
|
@MethodRuleNo(value = 2,desc = "自定义操作")
|
||||||
|
public static boolean cusOperate(Map<String,Object> updateParam, Map<String,Object> whereParam,Map<String,String> param) {
|
||||||
|
String operatePath = Util.null2String(param.get("operatePath"));
|
||||||
|
if(StringUtils.isBlank(operatePath)){
|
||||||
|
throw new CustomerException("操作全路径不能为空");
|
||||||
|
}
|
||||||
|
Map<String,String> pathParam = new HashMap<>();
|
||||||
|
try {
|
||||||
|
CusOperateInterface cusInterfaceObj = getCusInterfaceObj(operatePath, CusOperateInterface.class, pathParam);
|
||||||
|
cusInterfaceObj.execute(whereParam,param,pathParam);
|
||||||
|
}catch (Exception e){
|
||||||
|
logger.error("自定义处理类执行异常 ==>"+Util.getErrString(e));
|
||||||
|
throw new CustomerException(e);
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <h2>更新并执行自定义处理方法</h2>
|
||||||
|
* @param updateParam 更新参数
|
||||||
|
* @param whereParam 条件参数
|
||||||
|
* @param param 表参数
|
||||||
|
* @return 执行结果
|
||||||
|
*/
|
||||||
|
@MethodRuleNo(value = 3,desc = "更新并执行自定义操作")
|
||||||
|
public static boolean cusAndUpdate(Map<String,Object> updateParam, Map<String,Object> whereParam,Map<String,String> param) {
|
||||||
|
return update(updateParam,whereParam,param) && cusOperate(updateParam,whereParam,param);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <h2>插入并执行自定义处理方法</h2>
|
||||||
|
* @param updateParam 更新参数
|
||||||
|
* @param whereParam 条件参数
|
||||||
|
* @param param 表参数
|
||||||
|
* @return 执行结果
|
||||||
|
*/
|
||||||
|
@MethodRuleNo(value = 4,desc = "插入并执行自定义操作")
|
||||||
|
public static boolean cusAndInsert(Map<String,Object> updateParam, Map<String,Object> whereParam,Map<String,String> param) {
|
||||||
|
return insert(updateParam,whereParam,param) && cusOperate(updateParam,whereParam,param);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <h2>更新并执行自定义处理方法</h2>
|
||||||
|
* @param updateParam 更新参数
|
||||||
|
* @param whereParam 条件参数
|
||||||
|
* @param param 表参数
|
||||||
|
* @return 执行结果
|
||||||
|
*/
|
||||||
|
@MethodRuleNo(value = 5,desc = "执行自定义操作并更新")
|
||||||
|
public static boolean updateAndCus(Map<String,Object> updateParam, Map<String,Object> whereParam,Map<String,String> param) {
|
||||||
|
return cusOperate(updateParam,whereParam,param) && update(updateParam,whereParam,param);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <h2>插入并执行自定义处理方法</h2>
|
||||||
|
* @param updateParam 更新参数
|
||||||
|
* @param whereParam 条件参数
|
||||||
|
* @param param 表参数
|
||||||
|
* @return 执行结果
|
||||||
|
*/
|
||||||
|
@MethodRuleNo(value = 6,desc = "执行自定义操作并插入")
|
||||||
|
public static boolean insertAndCus(Map<String,Object> updateParam, Map<String,Object> whereParam,Map<String,String> param) {
|
||||||
|
return cusOperate(updateParam,whereParam,param) && insert(updateParam,whereParam,param);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <h2>构建更新sql语句</h2>
|
||||||
|
* @param tableName 表名
|
||||||
|
* @param updateParam 更新参数
|
||||||
|
* @return 更新语句
|
||||||
|
*/
|
||||||
|
public static String buildUpdateSql(String tableName, Map<String, Object> updateParam){
|
||||||
|
StringBuilder updateBuilder = new StringBuilder("update ");
|
||||||
|
updateBuilder.append(tableName).append(" set ");
|
||||||
|
Set<Map.Entry<String, Object>> updateEntries = updateParam.entrySet();
|
||||||
|
for (Map.Entry<String, Object> updateEntry : updateEntries) {
|
||||||
|
if("cusSql".equals(updateEntry.getKey())){
|
||||||
|
updateBuilder.append(updateEntry.getValue());
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
updateBuilder.append(updateEntry.getKey())
|
||||||
|
.append(" = ")
|
||||||
|
.append("#{updateParam.").append(updateEntry.getKey()).append("},");
|
||||||
|
}
|
||||||
|
return updateBuilder.substring(0, updateBuilder.length() - 1) + " ";
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <h2>构建条件sql语句</h2>
|
||||||
|
* @param whereParam 条件参数
|
||||||
|
* @return 条件语句
|
||||||
|
*/
|
||||||
|
public static String buildWhereSql(Map<String, Object> whereParam){
|
||||||
|
StringBuilder whereBuilder = new StringBuilder();
|
||||||
|
Set<Map.Entry<String, Object>> whereEntries = whereParam.entrySet();
|
||||||
|
for (Map.Entry<String, Object> whereEntry : whereEntries) {
|
||||||
|
if("cusSql".equals(whereEntry.getKey())){
|
||||||
|
whereBuilder.append(" and ").append(whereEntry.getValue());
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
whereBuilder.append(" and ")
|
||||||
|
.append(whereEntry.getKey())
|
||||||
|
.append("#{whereParam.").append(whereEntry.getKey()).append("},");
|
||||||
|
}
|
||||||
|
String fixStr = whereBuilder.toString();
|
||||||
|
if(!"".equals(fixStr)){
|
||||||
|
fixStr = fixStr.replaceFirst(" and "," where ");
|
||||||
|
}
|
||||||
|
return fixStr;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <h2></h2>
|
||||||
|
* @param path 全路径类名
|
||||||
|
* @param clazz 父类接口
|
||||||
|
* @param pathParamMap 路径参数
|
||||||
|
* @return 接口实现类
|
||||||
|
* @param <T> 泛型
|
||||||
|
*/
|
||||||
|
public static <T> T getCusInterfaceObj(String path, Class<T> clazz, Map<String, String> pathParamMap) {
|
||||||
|
|
||||||
|
path = Util.sbc2dbcCase(path);
|
||||||
|
String[] split = path.split("\\?");
|
||||||
|
String classPath = split[0];
|
||||||
|
Class<?> aClass;
|
||||||
|
try {
|
||||||
|
aClass = Class.forName(classPath);
|
||||||
|
} catch (ClassNotFoundException e) {
|
||||||
|
throw new IllegalArgumentException("未能找到自定义接口:" + classPath);
|
||||||
|
}
|
||||||
|
if (!clazz.isAssignableFrom(aClass)) {
|
||||||
|
throw new IllegalArgumentException("自定义接口:" + classPath + " 不是"
|
||||||
|
+ clazz.getName() + "的子类或实现类!");
|
||||||
|
}
|
||||||
|
Constructor<?> constructor;
|
||||||
|
try {
|
||||||
|
constructor = aClass.getConstructor();
|
||||||
|
} catch (NoSuchMethodException e) {
|
||||||
|
throw new IllegalArgumentException(classPath + "没有空参构造方法,无法获取构造方法对象!");
|
||||||
|
}
|
||||||
|
T o;
|
||||||
|
try {
|
||||||
|
o = (T) constructor.newInstance();
|
||||||
|
} catch (InstantiationException | IllegalAccessException | InvocationTargetException e) {
|
||||||
|
throw new IllegalArgumentException("无法构造" + classPath + "对象!");
|
||||||
|
}
|
||||||
|
pathParamMap.putAll(Util.parseCusInterfacePathParam(path));
|
||||||
|
return o;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,106 @@
|
||||||
|
package weaver.bokang.xiao.common.model_update.process;
|
||||||
|
|
||||||
|
import aiyh.utils.Util;
|
||||||
|
import aiyh.utils.annotation.MethodRuleNo;
|
||||||
|
import aiyh.utils.excention.CustomerException;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.apache.log4j.Logger;
|
||||||
|
import weaver.bokang.xiao.common.model_update.entity.AssignmentEntity;
|
||||||
|
import weaver.bokang.xiao.common.model_update.mapper.UpdateModeMapper;
|
||||||
|
import weaver.general.TimeUtil;
|
||||||
|
|
||||||
|
import java.lang.reflect.InvocationTargetException;
|
||||||
|
import java.lang.reflect.Method;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.function.BiFunction;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ClassName ValueSelectProcess
|
||||||
|
* @Author 肖博亢
|
||||||
|
* @Date 2023/4/6 12:42
|
||||||
|
* @Description <h1>赋值 - 取值类型相关处理</h1>
|
||||||
|
**/
|
||||||
|
public class ValueSelectProcess {
|
||||||
|
|
||||||
|
public static final Map<Integer, BiFunction<Map<String,Object>, AssignmentEntity, String>> SOURCE_MODE_METHOD_MAP = new HashMap<>();
|
||||||
|
|
||||||
|
private static final UpdateModeMapper UPDATE_MODE_MAPPER = Util.getMapper(UpdateModeMapper.class);
|
||||||
|
|
||||||
|
public static final Logger logger = Util.getLogger();
|
||||||
|
|
||||||
|
static {
|
||||||
|
try {
|
||||||
|
Class<ValueSelectProcess> valueRuleMethodClass = ValueSelectProcess.class;
|
||||||
|
Method[] methods = valueRuleMethodClass.getDeclaredMethods();
|
||||||
|
for (Method method : methods) {
|
||||||
|
if (method.isAnnotationPresent(MethodRuleNo.class)) {
|
||||||
|
MethodRuleNo annotation = method.getAnnotation(MethodRuleNo.class);
|
||||||
|
int value = annotation.value();
|
||||||
|
SOURCE_MODE_METHOD_MAP.put(value, (modeMap, assignment) -> {
|
||||||
|
try {
|
||||||
|
return (String) method.invoke(null,modeMap, assignment);
|
||||||
|
} catch (IllegalAccessException | InvocationTargetException e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}catch (Exception exception){
|
||||||
|
logger.error("ValueTypeProcess init error !!! "+Util.getErrString(exception));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <h2>默认值处理方法</h2>
|
||||||
|
* @param modeMap 源建模值
|
||||||
|
* @param assignment 赋值实体信息
|
||||||
|
* @return 值信息
|
||||||
|
*/
|
||||||
|
@MethodRuleNo(value = 0, desc = "默认值")
|
||||||
|
public static String defaultValue(Map<String,Object> modeMap, AssignmentEntity assignment) {
|
||||||
|
return assignment.getCusContext();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <h2>建模字段处理方法</h2>
|
||||||
|
* @param modeMap 源建模值
|
||||||
|
* @param assignment 赋值实体信息
|
||||||
|
* @return 值信息
|
||||||
|
*/
|
||||||
|
@MethodRuleNo(value = 1, desc = "建模字段")
|
||||||
|
public static String modeField(Map<String,Object> modeMap, AssignmentEntity assignment) {
|
||||||
|
return Util.null2String(modeMap.get(assignment.getSourceFieldName()));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <h2>自定义sql处理方法</h2>
|
||||||
|
* @param modeMap 源建模值
|
||||||
|
* @param assignment 赋值实体信息
|
||||||
|
* @return 值信息
|
||||||
|
*/
|
||||||
|
@MethodRuleNo(value = 2, desc = "自定义sql")
|
||||||
|
public static String cusSql(Map<String,Object> modeMap, AssignmentEntity assignment) {
|
||||||
|
String cusSqlStr = Util.null2String(assignment.getCusContext());
|
||||||
|
cusSqlStr = Util.dbc2sbcCase(cusSqlStr);
|
||||||
|
if(StringUtils.isBlank(cusSqlStr)){
|
||||||
|
throw new CustomerException("选择自定义sql时,sql字符串不能为空");
|
||||||
|
}
|
||||||
|
if(!cusSqlStr.startsWith("select ")){
|
||||||
|
throw new CustomerException("选择自定义sql时,不允许执行除select之外的其他危险操作 !!!");
|
||||||
|
}
|
||||||
|
return UPDATE_MODE_MAPPER.executeCusSql(cusSqlStr, modeMap,new HashMap<>());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <h2>当前时间处理方法</h2>
|
||||||
|
* @param modeMap 源建模值
|
||||||
|
* @param assignment 赋值实体信息
|
||||||
|
* @return 值信息
|
||||||
|
*/
|
||||||
|
@MethodRuleNo(value = 3, desc = "当前时间")
|
||||||
|
public static String currentTime(Map<String,Object> modeMap, AssignmentEntity assignment) {
|
||||||
|
return TimeUtil.getCurrentTimeString();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,106 @@
|
||||||
|
package weaver.bokang.xiao.common.model_update.process;
|
||||||
|
|
||||||
|
import aiyh.utils.Util;
|
||||||
|
import aiyh.utils.annotation.MethodRuleNo;
|
||||||
|
import aiyh.utils.excention.CustomerException;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.apache.log4j.Logger;
|
||||||
|
import weaver.bokang.xiao.common.model_update.entity.ConditionEntity;
|
||||||
|
import weaver.bokang.xiao.common.model_update.mapper.UpdateModeMapper;
|
||||||
|
import weaver.general.TimeUtil;
|
||||||
|
|
||||||
|
import java.lang.reflect.InvocationTargetException;
|
||||||
|
import java.lang.reflect.Method;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.function.BiFunction;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ClassName ValueTypeProcess
|
||||||
|
* @Author 肖博亢
|
||||||
|
* @Date 2023/4/4 16:18
|
||||||
|
* @Description <h1>条件配置 - 取值类型相关处理</h1>
|
||||||
|
**/
|
||||||
|
public class ValueTypeProcess {
|
||||||
|
|
||||||
|
public static final Map<Integer,BiFunction<Map<String,Object>, ConditionEntity, String>> SOURCE_MODE_METHOD_MAP = new HashMap<>();
|
||||||
|
|
||||||
|
private static final UpdateModeMapper UPDATE_MODE_MAPPER = Util.getMapper(UpdateModeMapper.class);
|
||||||
|
|
||||||
|
public static final Logger logger = Util.getLogger();
|
||||||
|
|
||||||
|
static {
|
||||||
|
try {
|
||||||
|
Class<ValueTypeProcess> valueRuleMethodClass = ValueTypeProcess.class;
|
||||||
|
Method[] methods = valueRuleMethodClass.getDeclaredMethods();
|
||||||
|
for (Method method : methods) {
|
||||||
|
if (method.isAnnotationPresent(MethodRuleNo.class)) {
|
||||||
|
MethodRuleNo annotation = method.getAnnotation(MethodRuleNo.class);
|
||||||
|
int value = annotation.value();
|
||||||
|
SOURCE_MODE_METHOD_MAP.put(value, (modeMap, condition) -> {
|
||||||
|
try {
|
||||||
|
return (String) method.invoke(null,modeMap, condition);
|
||||||
|
} catch (IllegalAccessException | InvocationTargetException e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}catch (Exception exception){
|
||||||
|
logger.error("ValueTypeProcess init error !!! "+Util.getErrString(exception));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <h2>默认值处理方法</h2>
|
||||||
|
* @param modeMap 源建模值
|
||||||
|
* @param condition 条件实体信息
|
||||||
|
* @return 值信息
|
||||||
|
*/
|
||||||
|
@MethodRuleNo(value = 0, desc = "默认值")
|
||||||
|
public static String defaultValue(Map<String,Object> modeMap, ConditionEntity condition) {
|
||||||
|
return condition.getCusText();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <h2>建模字段处理方法</h2>
|
||||||
|
* @param modeMap 源建模值
|
||||||
|
* @param condition 条件实体信息
|
||||||
|
* @return 值信息
|
||||||
|
*/
|
||||||
|
@MethodRuleNo(value = 1, desc = "建模字段")
|
||||||
|
public static String modeField(Map<String,Object> modeMap, ConditionEntity condition) {
|
||||||
|
return Util.null2String(modeMap.get(condition.getConditionSourceFieldName()));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <h2>自定义sql处理方法</h2>
|
||||||
|
* @param modeMap 源建模值
|
||||||
|
* @param condition 条件实体信息
|
||||||
|
* @return 值信息
|
||||||
|
*/
|
||||||
|
@MethodRuleNo(value = 2, desc = "自定义sql")
|
||||||
|
public static String cusSql(Map<String,Object> modeMap, ConditionEntity condition) {
|
||||||
|
String cusSqlStr = Util.null2String(condition.getCusText());
|
||||||
|
cusSqlStr = Util.dbc2sbcCase(cusSqlStr);
|
||||||
|
if(StringUtils.isBlank(cusSqlStr)){
|
||||||
|
throw new CustomerException("选择自定义sql时,sql字符串不能为空");
|
||||||
|
}
|
||||||
|
if(!cusSqlStr.startsWith("select ")){
|
||||||
|
throw new CustomerException("选择自定义sql时,不允许执行除select之外的其他危险操作 !!!");
|
||||||
|
}
|
||||||
|
return UPDATE_MODE_MAPPER.executeCusSql(cusSqlStr, modeMap,new HashMap<>());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <h2>当前时间处理方法</h2>
|
||||||
|
* @param modeMap 源建模值
|
||||||
|
* @param condition 条件实体信息
|
||||||
|
* @return 值信息
|
||||||
|
*/
|
||||||
|
@MethodRuleNo(value = 3, desc = "当前时间")
|
||||||
|
public static String currentTime(Map<String,Object> modeMap, ConditionEntity condition) {
|
||||||
|
return TimeUtil.getCurrentTimeString();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,248 @@
|
||||||
|
package weaver.bokang.xiao.common.model_update.service;
|
||||||
|
|
||||||
|
import aiyh.utils.Util;
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
|
import org.apache.log4j.Logger;
|
||||||
|
import weaver.bokang.xiao.common.model_update.entity.AssignmentEntity;
|
||||||
|
import weaver.bokang.xiao.common.model_update.entity.ConditionEntity;
|
||||||
|
import weaver.bokang.xiao.common.model_update.entity.UpdateModeConf;
|
||||||
|
import weaver.bokang.xiao.common.model_update.function.ConditionFunction;
|
||||||
|
import weaver.bokang.xiao.common.model_update.mapper.UpdateModeMapper;
|
||||||
|
import weaver.bokang.xiao.common.model_update.process.*;
|
||||||
|
import weaver.bokang.xiao.common.model_update.store.TableNameStore;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Objects;
|
||||||
|
import java.util.function.BiFunction;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ClassName ModeChangeService
|
||||||
|
* @Author 肖博亢
|
||||||
|
* @Date 2023/4/6 11:28
|
||||||
|
* @Description <h1></h1>
|
||||||
|
**/
|
||||||
|
public class ModeChangeService {
|
||||||
|
|
||||||
|
public final Logger logger = Util.getLogger();
|
||||||
|
|
||||||
|
private final UpdateModeMapper updateModeMapper = Util.getMapper(UpdateModeMapper.class);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <h2>更新其他建模信息</h2>
|
||||||
|
* @param modeMap 模块数据
|
||||||
|
* @param formId 表单id
|
||||||
|
* @param triggerType 触发方式 0:无条件触发; 1:建模更新触发; 2:其他触发
|
||||||
|
*/
|
||||||
|
public void changeOtherMode(Map<String,Object> modeMap, String formId,int triggerType){
|
||||||
|
Map<String, List<UpdateModeConf>> triggerStore = TableNameStore.getInstance().getTriggerStore();
|
||||||
|
List<UpdateModeConf> updateModeConfList = triggerStore.get(formId);
|
||||||
|
if(Objects.isNull(updateModeConfList) || updateModeConfList.isEmpty()){
|
||||||
|
logger.error(String.format("此表单建模[%s] 未配置相关更新信息,请检查!!!",formId));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
List<UpdateModeConf> collect = updateModeConfList.stream().filter(item -> item.getNoRule() == triggerType).collect(Collectors.toList());
|
||||||
|
if(collect.isEmpty()){
|
||||||
|
logger.error(String.format("此表单建模[%s] 未配置相关更新信息,请检查!!!",formId));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
doChange(modeMap,collect);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <h2>更新其他建模信息</h2>
|
||||||
|
* @param formId 原建模表单ID
|
||||||
|
*/
|
||||||
|
public void changeOtherMode(String formId){
|
||||||
|
Map<String, List<UpdateModeConf>> triggerStore = TableNameStore.getInstance().getTriggerStore();
|
||||||
|
List<UpdateModeConf> updateModeConfList = triggerStore.get(formId);
|
||||||
|
if(Objects.isNull(updateModeConfList) || updateModeConfList.isEmpty()){
|
||||||
|
logger.error(String.format("此建模[%s] 未配置相关更新信息,请检查!!!",formId));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
doChange(updateModeConfList);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <h2>更新其他表数据的具体方法</h2>
|
||||||
|
* @param updateModeConfList 配置参数列表
|
||||||
|
*/
|
||||||
|
private void doChange(List<UpdateModeConf> updateModeConfList){
|
||||||
|
for (UpdateModeConf updateModeConf : updateModeConfList) {
|
||||||
|
List<ConditionEntity> conditionList = updateModeConf.getConditionList();
|
||||||
|
Integer noRule = updateModeConf.getNoRule();
|
||||||
|
String sourceTableName = updateModeConf.getSourceTableName();
|
||||||
|
if(noRule == 1 && conditionList.isEmpty()){
|
||||||
|
logger.error(String.format("没有条件设置,不允许建模 %s 更新",updateModeConf.getTargetTableName()));
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
logger.info(String.format("处理配置 deal config [%s - %s]",updateModeConf.getUniqueCode(),updateModeConf.getDescription()));
|
||||||
|
if(Objects.nonNull(conditionList) && !conditionList.isEmpty()){
|
||||||
|
//条件数据
|
||||||
|
Map<String,Object> whereParam = new HashMap<>(8);
|
||||||
|
Map<Integer, List<ConditionEntity>> collect = conditionList.stream().collect(Collectors.groupingBy(ConditionEntity::getConditionType));
|
||||||
|
//获取源建模数据判断条件配置列表
|
||||||
|
List<ConditionEntity> sourceConditions = collect.get(0);
|
||||||
|
//获取目标建模条件生成配置列表
|
||||||
|
List<ConditionEntity> targetConditions = collect.get(1);
|
||||||
|
//生成查询sql
|
||||||
|
if(Objects.nonNull(sourceConditions) && !sourceConditions.isEmpty()) {
|
||||||
|
String whereSql = getWhereSql(new HashMap<>(), sourceConditions, whereParam);
|
||||||
|
String querySql = "select * from " + sourceTableName + whereSql;
|
||||||
|
List<Map<String, Object>> modeDataList = updateModeMapper.executeCusSqlList(querySql, whereParam, new HashMap<>());
|
||||||
|
if(Objects.nonNull(modeDataList) && !modeDataList.isEmpty()){
|
||||||
|
for (Map<String, Object> modeMap : modeDataList) {
|
||||||
|
updateOtherModel(modeMap,updateModeConf,targetConditions);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <h2>更新其他表的数据</h2>
|
||||||
|
* @param modeMap 原建模数据
|
||||||
|
* @param updateModeConf 配置信息
|
||||||
|
* @param targetConditions 条件判断
|
||||||
|
*/
|
||||||
|
private void updateOtherModel(Map<String,Object> modeMap,UpdateModeConf updateModeConf,List<ConditionEntity> targetConditions){
|
||||||
|
List<AssignmentEntity> assignmentList = updateModeConf.getAssignmentList();
|
||||||
|
Integer dataInType = updateModeConf.getDataInType();
|
||||||
|
//赋值数据
|
||||||
|
Map<String,Object> assignmentMap = new HashMap<>(8);
|
||||||
|
//条件sql
|
||||||
|
String whereSql = "";
|
||||||
|
//条件数据
|
||||||
|
Map<String,Object> whereParam = new HashMap<>(8);
|
||||||
|
//根据赋值配置组装数据
|
||||||
|
if(Objects.nonNull(assignmentList) && !assignmentList.isEmpty()){
|
||||||
|
//根据配置信息生成条件sql
|
||||||
|
if(Objects.nonNull(targetConditions) && !targetConditions.isEmpty()) {
|
||||||
|
getWhereSql(modeMap,targetConditions,whereParam);
|
||||||
|
}
|
||||||
|
for (AssignmentEntity assignmentEntity : assignmentList) {
|
||||||
|
BiFunction<Map<String, Object>, AssignmentEntity, String> valueFunction = ValueSelectProcess.SOURCE_MODE_METHOD_MAP.get(assignmentEntity.getValueSelect());
|
||||||
|
String assignmentValue = valueFunction.apply(modeMap, assignmentEntity);
|
||||||
|
assignmentMap.put(assignmentEntity.getAssignmentFieldName(),assignmentValue);
|
||||||
|
}
|
||||||
|
//执行数据操作
|
||||||
|
ConditionFunction<Boolean, Map<String, Object>, Map<String, Object>, Map<String,String>> dataInFunction = DataTypeProcess.SOURCE_MODE_METHOD_MAP.get(dataInType);
|
||||||
|
Map<String,String> tableMap = new HashMap<>(8);
|
||||||
|
tableMap.put("tableName",updateModeConf.getTargetTableName());
|
||||||
|
tableMap.put("whereSql",whereSql);
|
||||||
|
tableMap.put("operatePath",updateModeConf.getOperatePath());
|
||||||
|
boolean executeFlag = dataInFunction.apply(assignmentMap, whereParam, tableMap);
|
||||||
|
logger.info("更新结果 executeFlag ==>"+executeFlag);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <h2>获取配置条件sql</h2>
|
||||||
|
* @param modeMap 原建模数据
|
||||||
|
* @param conditions 条件参数
|
||||||
|
* @param whereParam 返回的参数新
|
||||||
|
* @return whereSql
|
||||||
|
*/
|
||||||
|
private String getWhereSql(Map<String,Object> modeMap,List<ConditionEntity> conditions,Map<String,Object> whereParam){
|
||||||
|
//条件sql
|
||||||
|
String whereSql = "";
|
||||||
|
for (ConditionEntity targetCondition : conditions) {
|
||||||
|
BiFunction<Map<String, Object>, ConditionEntity, String> valueFunction = ValueTypeProcess.SOURCE_MODE_METHOD_MAP.get(targetCondition.getValueType());
|
||||||
|
ConditionFunction<String, Map<String, Object>, Map<String, Object>, String> conditionFunction = ConditionTargetProcess.TARGET_MODE_METHOD_MAP.get(targetCondition.getConditionValue());
|
||||||
|
String sourceValue = Util.null2String(modeMap.get(targetCondition.getConditionSourceFieldName()));
|
||||||
|
String conditionValue = valueFunction.apply(modeMap, targetCondition);
|
||||||
|
Map<String, Object> param = new HashMap<>(8);
|
||||||
|
param.put("sourceValue", sourceValue);
|
||||||
|
param.put("conditionValue", conditionValue);
|
||||||
|
param.put("targetFieldName", targetCondition.getConditionTargetFieldName());
|
||||||
|
whereSql = conditionFunction.apply(whereParam, param, whereSql);
|
||||||
|
}
|
||||||
|
return whereSql;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <h2>更新其他表数据的具体方法</h2>
|
||||||
|
* @param modeMap 源建模数据
|
||||||
|
* @param updateModeConfList 配置参数列表
|
||||||
|
*/
|
||||||
|
private void doChange(Map<String,Object> modeMap,List<UpdateModeConf> updateModeConfList){
|
||||||
|
for (UpdateModeConf updateModeConf : updateModeConfList) {
|
||||||
|
List<ConditionEntity> conditionList = updateModeConf.getConditionList();
|
||||||
|
List<AssignmentEntity> assignmentList = updateModeConf.getAssignmentList();
|
||||||
|
Integer dataInType = updateModeConf.getDataInType();
|
||||||
|
Integer noRule = updateModeConf.getNoRule();
|
||||||
|
if(noRule == 1 && conditionList.isEmpty()){
|
||||||
|
logger.error(String.format("没有条件设置,不允许建模 %s 更新",updateModeConf.getTargetTableName()));
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
logger.info(String.format("处理配置 deal config [%s - %s]",updateModeConf.getUniqueCode(),updateModeConf.getDescription()));
|
||||||
|
//条件sql
|
||||||
|
String whereSql = "";
|
||||||
|
//条件数据
|
||||||
|
Map<String,Object> whereParam = new HashMap<>(8);
|
||||||
|
//赋值数据
|
||||||
|
Map<String,Object> assignmentMap = new HashMap<>(8);
|
||||||
|
if(Objects.nonNull(conditionList) && !conditionList.isEmpty()){
|
||||||
|
Map<Integer, List<ConditionEntity>> collect = conditionList.stream().collect(Collectors.groupingBy(ConditionEntity::getConditionType));
|
||||||
|
//获取源建模数据判断条件配置列表
|
||||||
|
List<ConditionEntity> sourceConditions = collect.get(0);
|
||||||
|
//获取目标建模条件生成配置列表
|
||||||
|
List<ConditionEntity> targetConditions = collect.get(1);
|
||||||
|
boolean flag = false;
|
||||||
|
//判断源建模数据是否需要触发更新
|
||||||
|
if(Objects.nonNull(sourceConditions) && !sourceConditions.isEmpty()) {
|
||||||
|
for (ConditionEntity sourceCondition : sourceConditions) {
|
||||||
|
BiFunction<Map<String, Object>, ConditionEntity, String> valueFunction = ValueTypeProcess.SOURCE_MODE_METHOD_MAP.get(sourceCondition.getValueType());
|
||||||
|
BiFunction<String, String, Boolean> conditionFunction = ConditionValueProcess.SOURCE_MODE_METHOD_MAP.get(sourceCondition.getConditionValue());
|
||||||
|
String sourceValue = Util.null2String(modeMap.get(sourceCondition.getConditionSourceFieldName()));
|
||||||
|
String conditionValue = valueFunction.apply(modeMap, sourceCondition);
|
||||||
|
Boolean result = conditionFunction.apply(sourceValue, conditionValue);
|
||||||
|
if (!result) {
|
||||||
|
flag = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (flag) {
|
||||||
|
logger.info("源建模条件判断不通过,此条数据跳过 sourceMode condition fail !!! "+JSON.toJSONString(modeMap));
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//根据配置信息生成条件sql
|
||||||
|
if(Objects.nonNull(targetConditions) && !targetConditions.isEmpty()) {
|
||||||
|
for (ConditionEntity targetCondition : targetConditions) {
|
||||||
|
BiFunction<Map<String, Object>, ConditionEntity, String> valueFunction = ValueTypeProcess.SOURCE_MODE_METHOD_MAP.get(targetCondition.getValueType());
|
||||||
|
ConditionFunction<String, Map<String, Object>, Map<String, Object>, String> conditionFunction = ConditionTargetProcess.TARGET_MODE_METHOD_MAP.get(targetCondition.getConditionValue());
|
||||||
|
String sourceValue = Util.null2String(modeMap.get(targetCondition.getConditionSourceFieldName()));
|
||||||
|
String conditionValue = valueFunction.apply(modeMap, targetCondition);
|
||||||
|
Map<String, Object> param = new HashMap<>(8);
|
||||||
|
param.put("sourceValue", sourceValue);
|
||||||
|
param.put("conditionValue", conditionValue);
|
||||||
|
param.put("targetFieldName", targetCondition.getConditionTargetFieldName());
|
||||||
|
whereSql = conditionFunction.apply(whereParam, param, whereSql);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//根据赋值配置组装数据
|
||||||
|
if(Objects.nonNull(assignmentList) && !assignmentList.isEmpty()){
|
||||||
|
for (AssignmentEntity assignmentEntity : assignmentList) {
|
||||||
|
BiFunction<Map<String, Object>, AssignmentEntity, String> valueFunction = ValueSelectProcess.SOURCE_MODE_METHOD_MAP.get(assignmentEntity.getValueSelect());
|
||||||
|
String assignmentValue = valueFunction.apply(modeMap, assignmentEntity);
|
||||||
|
assignmentMap.put(assignmentEntity.getAssignmentFieldName(),assignmentValue);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//执行数据操作
|
||||||
|
ConditionFunction<Boolean, Map<String, Object>, Map<String, Object>, Map<String,String>> dataInFunction = DataTypeProcess.SOURCE_MODE_METHOD_MAP.get(dataInType);
|
||||||
|
Map<String,String> tableMap = new HashMap<>(8);
|
||||||
|
tableMap.put("tableName",updateModeConf.getTargetTableName());
|
||||||
|
tableMap.put("whereSql",whereSql);
|
||||||
|
tableMap.put("operatePath",updateModeConf.getOperatePath());
|
||||||
|
boolean executeFlag = dataInFunction.apply(assignmentMap, whereParam, tableMap);
|
||||||
|
logger.info("更新结果 executeFlag ==>"+executeFlag);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,68 @@
|
||||||
|
package weaver.bokang.xiao.common.model_update.store;
|
||||||
|
|
||||||
|
import aiyh.utils.Util;
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
|
import lombok.Getter;
|
||||||
|
import org.apache.log4j.Logger;
|
||||||
|
import weaver.bokang.xiao.common.model_update.entity.UpdateModeConf;
|
||||||
|
import weaver.bokang.xiao.common.model_update.mapper.UpdateModeMapper;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Objects;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ClassName VendorStore
|
||||||
|
* @Author 肖博亢
|
||||||
|
* @Date 2023/3/17 18:31
|
||||||
|
* @Description <h1></h1>
|
||||||
|
**/
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
public class TableNameStore {
|
||||||
|
|
||||||
|
private final Map<String,String> tableNameStore = new HashMap<>();
|
||||||
|
|
||||||
|
private final Map<String,List<UpdateModeConf>> triggerStore = new HashMap<>();
|
||||||
|
|
||||||
|
private final Map<String,List<UpdateModeConf>> uniqueTriggerStore = new HashMap<>();
|
||||||
|
|
||||||
|
private final UpdateModeMapper updateModeMapper = Util.getMapper(UpdateModeMapper.class);
|
||||||
|
|
||||||
|
private static final Logger logger = Util.getLogger();
|
||||||
|
|
||||||
|
private TableNameStore(){init();}
|
||||||
|
|
||||||
|
private void init(){
|
||||||
|
try {
|
||||||
|
triggerStore.clear();
|
||||||
|
List<UpdateModeConf> updateModeConfList = updateModeMapper.queryUpdateModeConf();
|
||||||
|
if (Objects.nonNull(updateModeConfList) && !updateModeConfList.isEmpty()) {
|
||||||
|
Map<String, List<UpdateModeConf>> collect = updateModeConfList.stream().collect(Collectors.groupingBy(UpdateModeConf::getSourceMode));
|
||||||
|
Map<String, List<UpdateModeConf>> configMap = updateModeConfList.stream().collect(Collectors.groupingBy(UpdateModeConf::getUniqueCode));
|
||||||
|
triggerStore.putAll(collect);
|
||||||
|
uniqueTriggerStore.putAll(configMap);
|
||||||
|
}
|
||||||
|
logger.info(String.format("TableNameStore init success!!! triggerStore:%s \n uniqueTriggerStore: %s", JSON.toJSONString(triggerStore), JSON.toJSONString(uniqueTriggerStore)));
|
||||||
|
}catch (Exception e){
|
||||||
|
logger.error("TableNameStore init error !!!"+Util.getErrString(e));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void refresh(){
|
||||||
|
this.init();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static TableNameStore getInstance(){
|
||||||
|
return VendorStoreHolder.VENDOR_STORE;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static class VendorStoreHolder{
|
||||||
|
private VendorStoreHolder(){
|
||||||
|
|
||||||
|
}
|
||||||
|
private static final TableNameStore VENDOR_STORE = new TableNameStore();
|
||||||
|
}
|
||||||
|
}
|
|
@ -42,8 +42,8 @@ public class RepeatCheckAction extends SafeCusBaseAction {
|
||||||
private final RepeatCheckMapper repeatCheckMapper = Util.getMapper(RepeatCheckMapper.class);
|
private final RepeatCheckMapper repeatCheckMapper = Util.getMapper(RepeatCheckMapper.class);
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void doSubmit(String requestId, String billTable, int workflowId, User user, RequestInfo requestInfo) {
|
public void doSubmit(String requestId, String billTable, int workflowId, User user, RequestInfo requestInfo)
|
||||||
log.info(String.format("=================== {%s} {requestId : %s} begin ======================", this.getClass().getName(),requestId));
|
{log.info(String.format("=================== {%s} {requestId : %s} begin ======================", this.getClass().getName(),requestId));
|
||||||
Map<String, String> mainTable = this.getMainTableValue(requestInfo);
|
Map<String, String> mainTable = this.getMainTableValue(requestInfo);
|
||||||
String workflowNum = Util.null2String(mainTable.get(workflowNumField));
|
String workflowNum = Util.null2String(mainTable.get(workflowNumField));
|
||||||
int workflowCount = repeatCheckMapper.getWorkflowCount(billTable,workflowNumField,requestId, workflowNum);
|
int workflowCount = repeatCheckMapper.getWorkflowCount(billTable,workflowNumField,requestId, workflowNum);
|
||||||
|
|
|
@ -0,0 +1,81 @@
|
||||||
|
package weaver.bokang.xiao.porsche.action;
|
||||||
|
|
||||||
|
import aiyh.utils.Util;
|
||||||
|
import aiyh.utils.action.SafeCusBaseAction;
|
||||||
|
import aiyh.utils.annotation.ActionDesc;
|
||||||
|
import aiyh.utils.annotation.ActionOptionalParam;
|
||||||
|
import aiyh.utils.annotation.PrintParamMark;
|
||||||
|
import aiyh.utils.annotation.RequiredMark;
|
||||||
|
import aiyh.utils.excention.CustomerException;
|
||||||
|
import lombok.Setter;
|
||||||
|
import weaver.bokang.xiao.common.CommonUtil;
|
||||||
|
import weaver.bokang.xiao.common.mapper.WorkflowMapper;
|
||||||
|
import weaver.hrm.User;
|
||||||
|
import weaver.soa.workflow.request.RequestInfo;
|
||||||
|
|
||||||
|
import java.text.ParseException;
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ClassName DateFieldUpdateAction
|
||||||
|
* @Author 肖博亢
|
||||||
|
* @Date 2023/5/11 14:46
|
||||||
|
* @Description <h1></h1>
|
||||||
|
**/
|
||||||
|
@Setter
|
||||||
|
@ActionDesc(value = "时间自定义格式化",author = "bokang.xiao")
|
||||||
|
public class DateFieldUpdateAction extends SafeCusBaseAction {
|
||||||
|
|
||||||
|
@RequiredMark("原时间字段集合")
|
||||||
|
@PrintParamMark
|
||||||
|
private String sourceDateFields;
|
||||||
|
|
||||||
|
@RequiredMark("修改时间字段结合")
|
||||||
|
@PrintParamMark
|
||||||
|
private String targetDateFields;
|
||||||
|
|
||||||
|
@ActionOptionalParam(value = "MMMM d','yyyy",desc = "时间格式化字符串")
|
||||||
|
@PrintParamMark
|
||||||
|
private String formationString = "MMMM d','yyyy";
|
||||||
|
|
||||||
|
private final WorkflowMapper workflowMapper = Util.getMapper(WorkflowMapper.class);
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void doSubmit(String requestId, String billTable, int workflowId, User user, RequestInfo requestInfo) {
|
||||||
|
log.info(String.format("=================== {%s} {requestId : %s} begin ======================", this.getClass().getName(), requestId));
|
||||||
|
Map<String, Object> workflowData = workflowMapper.queryWorkflowByRequestId(requestId, billTable);
|
||||||
|
String[] sourceDateFieldArray = sourceDateFields.split(",");
|
||||||
|
String[] targetDateFieldArray = targetDateFields.split(",");
|
||||||
|
if(sourceDateFieldArray.length != targetDateFieldArray.length){
|
||||||
|
throw new CustomerException("请确保需要格式化的字段数量与存储字段数量一致");
|
||||||
|
}
|
||||||
|
Map<String,Object> dateFormat = new HashMap<>();
|
||||||
|
for (int i = 0; i < sourceDateFieldArray.length; i++) {
|
||||||
|
String sourceDateField = sourceDateFieldArray[i];
|
||||||
|
String targetDateField = targetDateFieldArray[i];
|
||||||
|
String sourceDate = Util.null2String(workflowData.get(sourceDateField));
|
||||||
|
String targetDate = formatDate(sourceDate);
|
||||||
|
dateFormat.put(targetDateField,targetDate);
|
||||||
|
}
|
||||||
|
Map<String,Object> whereParam = new HashMap<>();
|
||||||
|
whereParam.put("requestid",requestId);
|
||||||
|
String updateSql = CommonUtil.getCusUpdateSql(billTable, dateFormat, whereParam);
|
||||||
|
log.info("DateFieldUpdateAction updateSql ==>"+updateSql+" updateParam =>"+dateFormat+" whereParam =>"+whereParam);
|
||||||
|
boolean flag = workflowMapper.executeUpdateCusSql(updateSql, dateFormat, whereParam);
|
||||||
|
log.info("更新格式化日期结果 ==>"+flag);
|
||||||
|
}
|
||||||
|
|
||||||
|
private String formatDate(String dateStr){
|
||||||
|
try {
|
||||||
|
SimpleDateFormat sourceFormat = new SimpleDateFormat("yyyy-MM-dd");
|
||||||
|
SimpleDateFormat targetFormat = new SimpleDateFormat(formationString, Locale.US);
|
||||||
|
Date parse = sourceFormat.parse(dateStr);
|
||||||
|
return targetFormat.format(parse);
|
||||||
|
}catch (ParseException parseException){
|
||||||
|
log.error("时间格式化异常 format error!!!"+Util.getErrString(parseException));
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,24 @@
|
||||||
|
package weaver.bokang.xiao.porsche.mapper;
|
||||||
|
|
||||||
|
import aiyh.utils.annotation.recordset.*;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ClassName PorscheMapper
|
||||||
|
* @Author 肖博亢
|
||||||
|
* @Date 2023/5/9 17:56
|
||||||
|
* @Description <h1></h1>
|
||||||
|
**/
|
||||||
|
@SqlMapper
|
||||||
|
public interface PorscheMapper {
|
||||||
|
|
||||||
|
@Select("select * from uf_zcgsxx where $t{statusField} = 0")
|
||||||
|
List<Map<String,Object>> queryCompanyInfo(@ParamMapper("statusField")String statusField);
|
||||||
|
|
||||||
|
@Update("update uf_zcgsxx set sfrz = #{authenticationStatus},fadadaid = #{contractId} where id = #{dataId}")
|
||||||
|
boolean updateAuthenticationStatus(@ParamMapper("authenticationField")String authenticationStatus,
|
||||||
|
@ParamMapper("authenticationStatus")String companyNo,
|
||||||
|
@ParamMapper("dataId")int dataId);
|
||||||
|
}
|
|
@ -0,0 +1,69 @@
|
||||||
|
package weaver.bokang.xiao.porsche.schedule;
|
||||||
|
|
||||||
|
import aiyh.utils.Util;
|
||||||
|
import aiyh.utils.action.CusBaseCronJob;
|
||||||
|
import aiyh.utils.annotation.ActionDesc;
|
||||||
|
import aiyh.utils.annotation.PrintParamMark;
|
||||||
|
import aiyh.utils.annotation.RequiredMark;
|
||||||
|
import aiyh.utils.httpUtil.ResponeVo;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.Setter;
|
||||||
|
import weaver.aiyh_pcn.common_fadada.util.FaRequestUtils;
|
||||||
|
import weaver.bokang.xiao.porsche.mapper.PorscheMapper;
|
||||||
|
import weaver.xiao.commons.config.entity.RequestMappingConfig;
|
||||||
|
import weaver.xiao.commons.config.service.DealWithMapping;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ClassName CompanyWriteBackSchedule
|
||||||
|
* @Author 肖博亢
|
||||||
|
* @Date 2023/5/9 17:50
|
||||||
|
* @Description <h1></h1>
|
||||||
|
**/
|
||||||
|
@Setter
|
||||||
|
@ActionDesc(value = "公司认证信息同步", author = "bokang.xiao")
|
||||||
|
public class CompanyWriteBackSchedule extends CusBaseCronJob {
|
||||||
|
|
||||||
|
@RequiredMark("请求唯一标识")
|
||||||
|
@PrintParamMark
|
||||||
|
private String requestMark;
|
||||||
|
|
||||||
|
@RequiredMark("状态字段名")
|
||||||
|
@PrintParamMark
|
||||||
|
private String statusField;
|
||||||
|
|
||||||
|
private final DealWithMapping dealWithMapping = new DealWithMapping();
|
||||||
|
|
||||||
|
private final PorscheMapper porscheMapper = Util.getMapper(PorscheMapper.class);
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void runCode() throws IOException {
|
||||||
|
log.info("======= CompanyWriteBackSchedule execute ======");
|
||||||
|
List<Map<String,Object>> maps = porscheMapper.queryCompanyInfo(statusField);
|
||||||
|
if(Objects.nonNull(maps) && !maps.isEmpty()){
|
||||||
|
log.info("company list info ==>"+maps.size());
|
||||||
|
for (Map<String, Object> map : maps) {
|
||||||
|
RequestMappingConfig requestMappingConfig = dealWithMapping.treeDealWithUniqueCode(requestMark);
|
||||||
|
Map<String,Object> requestParam = dealWithMapping.getRequestParam(map, requestMappingConfig);
|
||||||
|
ResponeVo responeVo = FaRequestUtils.companyAuthentication(requestParam, requestMappingConfig.getRequestUrl());
|
||||||
|
if(responeVo.getCode() == 200){
|
||||||
|
Map<String,Object> result = responeVo.getResponseMap();
|
||||||
|
String code = Util.null2String(result.get("code"));
|
||||||
|
if("200".equals(code)){
|
||||||
|
List<Map<String,Object>> data = (List<Map<String, Object>>) result.get("data");
|
||||||
|
Map<String, Object> companyInfo = data.get(0);
|
||||||
|
Map<String,Object> certificationStatusResource = (Map<String, Object>) companyInfo.get("certificationStatusResource");
|
||||||
|
int dataId = Util.getIntValue(String.valueOf(map.get("id")));
|
||||||
|
String authenticationStatus = Util.null2String(certificationStatusResource.get("verifiedStatus"));
|
||||||
|
String companyNo = Util.null2String(companyInfo.get("companyInfo"));
|
||||||
|
porscheMapper.updateAuthenticationStatus(authenticationStatus,companyNo,dataId);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,32 @@
|
||||||
|
package weaver.bokang.xiao.porsche.schedule;
|
||||||
|
|
||||||
|
import aiyh.utils.action.CusBaseCronJob;
|
||||||
|
import aiyh.utils.annotation.ActionDesc;
|
||||||
|
import aiyh.utils.annotation.PrintParamMark;
|
||||||
|
import aiyh.utils.annotation.RequiredMark;
|
||||||
|
import lombok.Setter;
|
||||||
|
import weaver.bokang.xiao.common.model_update.service.ModeChangeService;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ClassName SalaryUpdateSchedule
|
||||||
|
* @Author 肖博亢
|
||||||
|
* @Date 2023/5/11 17:59
|
||||||
|
* @Description <h1></h1>
|
||||||
|
**/
|
||||||
|
@Setter
|
||||||
|
@ActionDesc(value = "定时更新薪酬信息", author = "bokang.xiao")
|
||||||
|
public class SalaryUpdateSchedule extends CusBaseCronJob {
|
||||||
|
|
||||||
|
@RequiredMark("原建模表单ID")
|
||||||
|
@PrintParamMark
|
||||||
|
private String formId;
|
||||||
|
|
||||||
|
private final ModeChangeService modeChangeService = new ModeChangeService();
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void runCode() throws IOException {
|
||||||
|
modeChangeService.changeOtherMode(formId);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,61 @@
|
||||||
|
package weaver.bokang.xiao.sh_bigdata.action;
|
||||||
|
|
||||||
|
import aiyh.utils.Util;
|
||||||
|
import aiyh.utils.action.SafeCusBaseAction;
|
||||||
|
import aiyh.utils.annotation.ActionDesc;
|
||||||
|
import aiyh.utils.annotation.ActionOptionalParam;
|
||||||
|
import aiyh.utils.annotation.PrintParamMark;
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
|
import lombok.Setter;
|
||||||
|
import weaver.bokang.xiao.common.mapper.WorkflowMapper;
|
||||||
|
import weaver.hrm.User;
|
||||||
|
import weaver.soa.workflow.request.RequestInfo;
|
||||||
|
import weaver.xiao.commons.config.entity.RequestMappingConfig;
|
||||||
|
import weaver.xiao.commons.config.service.DealWithMapping;
|
||||||
|
import weaver.xuanran.wang.sh_bigdata.common.entity.CusSuccess;
|
||||||
|
import weaver.xuanran.wang.sh_bigdata.common.util.RequestMasterPlate;
|
||||||
|
import weaver.xuanran.wang.sh_bigdata.common.util.ShBigDataUtil;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ClassName DataPushAction
|
||||||
|
* @Author 肖博亢
|
||||||
|
* @Date 2023/5/12 10:30
|
||||||
|
* @Description <h1></h1>
|
||||||
|
**/
|
||||||
|
@Setter
|
||||||
|
@ActionDesc(value = "数据采集对接-数据推送action",author = "bokang.xiao")
|
||||||
|
public class DataPushAction extends SafeCusBaseAction {
|
||||||
|
|
||||||
|
/** 数据推送接口唯一标识 */
|
||||||
|
@PrintParamMark
|
||||||
|
@ActionOptionalParam(value = "",desc = "数据推送接口唯一标识")
|
||||||
|
private String requestUnique;
|
||||||
|
|
||||||
|
private final WorkflowMapper workflowMapper = Util.getMapper(WorkflowMapper.class);
|
||||||
|
|
||||||
|
private final DealWithMapping dealWithMapping = new DealWithMapping();
|
||||||
|
|
||||||
|
private final RequestMasterPlate requestMasterPlate = new RequestMasterPlate();
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void doSubmit(String requestId, String billTable, int workflowId, User user, RequestInfo requestInfo) {
|
||||||
|
log.info(String.format("=================== {%s} {requestId : %s} begin ======================", this.getClass().getName(),requestId));
|
||||||
|
Map<String, Object> workflowMessage = workflowMapper.queryWorkflowByRequestId(requestId, billTable);
|
||||||
|
dealWithMapping.setMainTable(billTable);
|
||||||
|
RequestMappingConfig requestMappingConfig = dealWithMapping.treeDealWithUniqueCode(requestUnique);
|
||||||
|
Map<String, Object> requestParam = dealWithMapping.getRequestParam(workflowMessage, requestMappingConfig);
|
||||||
|
Map<String,String> header = new HashMap<>();
|
||||||
|
header.put("Content-Type","application/json");
|
||||||
|
CusSuccess cusSuccess = CusSuccess.builder()
|
||||||
|
.successField("code")
|
||||||
|
.successValue(0)
|
||||||
|
.errorMsg("msg")
|
||||||
|
.dataKey("data.data")
|
||||||
|
.build();
|
||||||
|
Map<String,Object> result = requestMasterPlate.apiPost(ShBigDataUtil.addToken2Url(requestMappingConfig.getRequestUrl()), requestParam, header, cusSuccess);
|
||||||
|
log.info("DataPushAction push data result ==>"+ JSON.toJSONString(result));
|
||||||
|
}
|
||||||
|
}
|
|
@ -33,7 +33,7 @@ import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @ClassName OneNetcomAction
|
* @ClassName OneNetComAction
|
||||||
* @Author 肖博亢
|
* @Author 肖博亢
|
||||||
* @Date 2023/3/27 14:04
|
* @Date 2023/3/27 14:04
|
||||||
* @Description <h1>一网通接口调用action</h1>
|
* @Description <h1>一网通接口调用action</h1>
|
||||||
|
|
|
@ -76,7 +76,9 @@ public interface UpdateModeMapper {
|
||||||
* @return 查询结果
|
* @return 查询结果
|
||||||
*/
|
*/
|
||||||
@Select(custom = true)
|
@Select(custom = true)
|
||||||
Map<String,Object> executeCusSqlMap(@SqlString String cusSql, @ParamMapper("whereParam")Map<String,Object> whereParam,@ParamMapper("cusParam")Map<String,Object> cusParam);
|
Map<String,Object> executeCusSqlMap(@SqlString String cusSql,
|
||||||
|
@ParamMapper("whereParam")Map<String,Object> whereParam,
|
||||||
|
@ParamMapper("cusParam")Map<String,Object> cusParam);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <h2>执行自定义更新sql</h2>
|
* <h2>执行自定义更新sql</h2>
|
||||||
|
@ -86,6 +88,8 @@ public interface UpdateModeMapper {
|
||||||
* @return 查询结果
|
* @return 查询结果
|
||||||
*/
|
*/
|
||||||
@Update(custom = true)
|
@Update(custom = true)
|
||||||
boolean executeUpdateCusSql(@SqlString String cusSql, @ParamMapper("updateParam")Map<String,Object> updateParam,@ParamMapper("whereParam")Map<String,Object> whereParam);
|
boolean executeUpdateCusSql(@SqlString String cusSql,
|
||||||
|
@ParamMapper("updateParam")Map<String,Object> updateParam,
|
||||||
|
@ParamMapper("whereParam")Map<String,Object> whereParam);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -125,7 +125,7 @@ public class DataTypeProcess {
|
||||||
* @param param 表参数
|
* @param param 表参数
|
||||||
* @return 执行结果
|
* @return 执行结果
|
||||||
*/
|
*/
|
||||||
@MethodRuleNo(value = 3,desc = "插入并执行自定义操作")
|
@MethodRuleNo(value = 3,desc = "更新并执行自定义操作")
|
||||||
public static boolean cusAndUpdate(Map<String,Object> updateParam, Map<String,Object> whereParam,Map<String,String> param) {
|
public static boolean cusAndUpdate(Map<String,Object> updateParam, Map<String,Object> whereParam,Map<String,String> param) {
|
||||||
return update(updateParam,whereParam,param) && cusOperate(updateParam,whereParam,param);
|
return update(updateParam,whereParam,param) && cusOperate(updateParam,whereParam,param);
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,42 @@
|
||||||
|
package weaver.bokang.xiao.zscq.fun;
|
||||||
|
|
||||||
|
import aiyh.utils.Util;
|
||||||
|
import weaver.bokang.xiao.zscq.config.function.CusOperateInterface;
|
||||||
|
import weaver.bokang.xiao.zscq.config.mapper.UpdateModeMapper;
|
||||||
|
import weaver.bokang.xiao.zscq.mapper.StatusMapper;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ClassName OdocUpdate
|
||||||
|
* @Author 肖博亢
|
||||||
|
* @Date 2023/5/9 15:24
|
||||||
|
* @Description <h1></h1>
|
||||||
|
**/
|
||||||
|
public class ODocUpdate implements CusOperateInterface {
|
||||||
|
|
||||||
|
private final UpdateModeMapper updateModeMapper = Util.getMapper(UpdateModeMapper.class);
|
||||||
|
|
||||||
|
private final StatusMapper statusMapper = Util.getMapper(StatusMapper.class);
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void execute(Map<String, Object> whereParam, Map<String, String> param, Map<String, String> pathParam) {
|
||||||
|
logger.info("==== ODocUpdate 自定义处理 ==== ");
|
||||||
|
String tableName = Util.null2String(param.get("tableName"));
|
||||||
|
String numField = Util.null2String(pathParam.get("numField"));
|
||||||
|
String querySql = "select * from " + tableName +" where "+ numField +"= #{whereParam."+numField+"}";
|
||||||
|
Map<String, Object> modeData = updateModeMapper.executeCusSqlMap(querySql, whereParam,new HashMap<>());
|
||||||
|
logger.info("modeData ==>"+modeData);
|
||||||
|
if(Objects.nonNull(modeData)){
|
||||||
|
String oDocRequestField = Util.null2String(pathParam.get("oDocRequestField"));
|
||||||
|
String oDocTextField = Util.null2String(pathParam.get("oDocTextField"));
|
||||||
|
String workflowTextField = Util.null2String(pathParam.get("workflowTextField"));
|
||||||
|
String requestId = Util.null2String(modeData.get("requestid"));
|
||||||
|
String workflowText = Util.null2String(modeData.get(workflowTextField));
|
||||||
|
boolean flag = statusMapper.updateODocField(oDocTextField, workflowText, oDocRequestField, requestId);
|
||||||
|
logger.info("更新odoc表数据结果 ==>"+flag);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -26,7 +26,7 @@ public class WorkflowOverOperate implements CusOperateInterface {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void execute(Map<String, Object> whereParam, Map<String, String> param, Map<String, String> pathParam) {
|
public void execute(Map<String, Object> whereParam, Map<String, String> param, Map<String, String> pathParam) {
|
||||||
logger.info(String.format("WorkflowOverOperate 自定义处理 whereParam[%s],param:[%s],pathParam:[%s]",whereParam,param,pathParam));
|
logger.info("===== WorkflowOverOperate 自定义处理 ===== ");
|
||||||
String tableName = Util.null2String(param.get("tableName"));
|
String tableName = Util.null2String(param.get("tableName"));
|
||||||
String whereSql = Util.null2String(param.get("whereSql"));
|
String whereSql = Util.null2String(param.get("whereSql"));
|
||||||
if(!"".equals(whereSql)){
|
if(!"".equals(whereSql)){
|
||||||
|
|
|
@ -29,7 +29,7 @@ public class WorkflowRepossessedSign implements CusOperateInterface {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void execute(Map<String, Object> whereParam, Map<String, String> param, Map<String, String> pathParam) {
|
public void execute(Map<String, Object> whereParam, Map<String, String> param, Map<String, String> pathParam) {
|
||||||
logger.info(String.format("WorkflowRepossessedSign 自定义处理 whereParam[%s],param:[%s],pathParam:[%s]",whereParam,param,pathParam));
|
logger.info("==== WorkflowRepossessedSign 自定义处理 ====");
|
||||||
String tableName = Util.null2String(param.get("tableName"));
|
String tableName = Util.null2String(param.get("tableName"));
|
||||||
String whereSql = Util.null2String(param.get("whereSql"));
|
String whereSql = Util.null2String(param.get("whereSql"));
|
||||||
if(!"".equals(whereSql)){
|
if(!"".equals(whereSql)){
|
||||||
|
|
|
@ -32,4 +32,10 @@ public interface StatusMapper {
|
||||||
@Select("select currentnodetype from workflow_requestbase where requestid = #{requestId}")
|
@Select("select currentnodetype from workflow_requestbase where requestid = #{requestId}")
|
||||||
int queryWorkflowStatus(@ParamMapper("requestId")String requestId);
|
int queryWorkflowStatus(@ParamMapper("requestId")String requestId);
|
||||||
|
|
||||||
|
@Update("update odoc_requestdoc set $t{fieldName} = #{fieldValue} where $t{oDocRequestField} = #{requestId}")
|
||||||
|
boolean updateODocField(@ParamMapper("fieldName")String fieldName,
|
||||||
|
@ParamMapper("fieldValue")String fieldValue,
|
||||||
|
@ParamMapper("oDocRequestField")String oDocRequestField,
|
||||||
|
@ParamMapper("requestId")String requestId);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,4 +3,6 @@ aiyh.htmllabel.porsche.faddcontractcontroller.pusherr.defaultstr=邮件发送失
|
||||||
aiyh.htmllabel.porsche.faddcontractcontroller.pushsuccess.labelindex=-1
|
aiyh.htmllabel.porsche.faddcontractcontroller.pushsuccess.labelindex=-1
|
||||||
aiyh.htmllabel.porsche.faddcontractcontroller.pushsuccess.defaultstr=签署邮件发送成功!
|
aiyh.htmllabel.porsche.faddcontractcontroller.pushsuccess.defaultstr=签署邮件发送成功!
|
||||||
attachment_sort.annexsortaction.sorterr.labelindex=-1
|
attachment_sort.annexsortaction.sorterr.labelindex=-1
|
||||||
attachment_sort.annexsortaction.sorterr.defaultstr=文件排序失败,请联系系统管理员!
|
attachment_sort.annexsortaction.sorterr.defaultstr=文件排序失败,请联系系统管理员!
|
||||||
|
xbk.contractRepush.errorMsg.labelindex=-83377
|
||||||
|
xbk.contractRepush.errorMsg.defaultstr=我是傻狗
|
|
@ -0,0 +1,500 @@
|
||||||
|
<%@ page language="java" contentType="text/html; charset=UTF-8" %>
|
||||||
|
<%@ include file="/systeminfo/init_wev8.jsp"%>
|
||||||
|
<%@ taglib uri="/WEB-INF/weaver.tld" prefix="wea"%>
|
||||||
|
<%@ taglib uri="/WEB-INF/tld/browser.tld" prefix="brow"%>
|
||||||
|
|
||||||
|
<%@ page import="weaver.file.Prop" %>
|
||||||
|
<%@ page import="weaver.hrm.HrmUserVarify" %>
|
||||||
|
<%@ page import="weaver.systeminfo.SystemEnv" %>
|
||||||
|
|
||||||
|
<jsp:useBean id="RecordSet" class="weaver.conn.RecordSet" scope="page" />
|
||||||
|
<jsp:useBean id="RecordSet_count" class="weaver.conn.RecordSet" scope="page" />
|
||||||
|
<jsp:useBean id="ResourceComInfo" class="weaver.hrm.resource.ResourceComInfo" scope="page" />
|
||||||
|
<jsp:useBean id="DepartmentComInfo" class="weaver.hrm.company.DepartmentComInfo" scope="page" />
|
||||||
|
<jsp:useBean id="CrmSupplierComInfo" class="weaver.crm.supplierinfo.CrmSupplierComInfo" scope="page" />
|
||||||
|
<jsp:useBean id="RecordSet_Dep" class="weaver.conn.RecordSet" scope="page" />
|
||||||
|
<jsp:useBean id="SubCompanyComInfo" class="weaver.hrm.company.SubCompanyComInfo" scope="page" /><!--zl-->
|
||||||
|
|
||||||
|
<HTML>
|
||||||
|
<HEAD>
|
||||||
|
<LINK href="/css/Weaver_wev8.css" type=text/css rel=STYLESHEET>
|
||||||
|
<SCRIPT language="javascript" src="/js/weaver_wev8.js"></script>
|
||||||
|
<style>
|
||||||
|
|
||||||
|
td * {font-size:9px !important;}
|
||||||
|
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<%
|
||||||
|
|
||||||
|
String sqlwhere = " where 1=1 ";
|
||||||
|
|
||||||
|
String subcompanyid1 = ResourceComInfo.getSubCompanyID(String.valueOf(user.getUID()));
|
||||||
|
|
||||||
|
//是否采购部
|
||||||
|
boolean isDep = false;
|
||||||
|
//是否是流程接收人
|
||||||
|
boolean isShow = false;
|
||||||
|
//采购部的同事可以选择所有合同卡片;而本部门的人员(非采购部)只能选择本部门的合同卡片
|
||||||
|
RecordSet_Dep.executeSql("select * from HrmDepartment where departmentname like '%采购%' and id="+user.getUserDepartment());
|
||||||
|
if(RecordSet_Dep.next()) isDep = true;
|
||||||
|
|
||||||
|
//是否合同流程接收人
|
||||||
|
String sqlwhere_workflow = "";
|
||||||
|
RecordSet_Dep.executeSql("select distinct requestId from workflow_currentoperator where workflowid in (79,148,133,128,118,108,98,153,167,316,470,514,532,543,600,717,719,739,832,927,929) and userid="+user.getUID());
|
||||||
|
if(RecordSet_Dep.next()) isShow = true;
|
||||||
|
|
||||||
|
if(!HrmUserVarify.checkUserRight("ContactInfo:Manager", user) && !HrmUserVarify.checkUserRight("ContactInfo:User", user) && !isShow && !isDep){
|
||||||
|
response.sendRedirect("/notice/noright.jsp");
|
||||||
|
}
|
||||||
|
|
||||||
|
//如果是合同管理权限,则直接1=1
|
||||||
|
if(HrmUserVarify.checkUserRight("ContactInfo:Manager", user)){
|
||||||
|
sqlwhere += " and 1=1";
|
||||||
|
}else if(isShow && HrmUserVarify.checkUserRight("ContactInfo:User", user)){
|
||||||
|
//如果是流程接收人,并且有合同查看权限
|
||||||
|
sqlwhere += " and (requestid in (select distinct requestId from workflow_currentoperator where workflowid in (79,148,133,128,118,108,98,153,167,316,470,514,532,543,600,717,719,739,832,927,929) and userid="+user.getUID()+") or reqDeptId = '"+user.getUserDepartment()+"')";
|
||||||
|
|
||||||
|
}else if(HrmUserVarify.checkUserRight("ContactInfo:User", user)){
|
||||||
|
//如果只有合同查看权限
|
||||||
|
sqlwhere += " and reqDeptId = '"+user.getUserDepartment()+"'";
|
||||||
|
|
||||||
|
}else if(isShow){
|
||||||
|
//如果只是流程接收人
|
||||||
|
sqlwhere += " and requestid in (select distinct requestId from workflow_currentoperator where workflowid in (79,148,133,128,118,108,98,153,167,316,470,514,532,543,600,717,719,739,832,927,929) and userid="+user.getUID()+")";
|
||||||
|
}
|
||||||
|
|
||||||
|
//如果没有查看全部的权限,加分部条件
|
||||||
|
if(!HrmUserVarify.checkUserRight("ContactInfoList:ALL", user)){
|
||||||
|
if (!subcompanyid1.equals("0")) {sqlwhere += " and CrmContractInfo.subcompanyid1 = '"+subcompanyid1+"' ";}
|
||||||
|
}
|
||||||
|
String imagefilename = "/images/hdReport.gif";
|
||||||
|
String titlename = SystemEnv.getHtmlLabelName(614, user.getLanguage()) + SystemEnv.getHtmlLabelName(527, user.getLanguage());
|
||||||
|
String needfav = "1";
|
||||||
|
String needhelp = "";
|
||||||
|
%>
|
||||||
|
<BODY>
|
||||||
|
<%@ include file="/systeminfo/TopTitle_wev8.jsp"%>
|
||||||
|
<%@ include file="/systeminfo/RightClickMenuConent_wev8.jsp"%>
|
||||||
|
<%
|
||||||
|
RCMenu += "{" + SystemEnv.getHtmlLabelName(197, user.getLanguage()) + ",javascript:OnSearch(),_top} ";
|
||||||
|
RCMenuHeight += RCMenuHeightStep;
|
||||||
|
RCMenu += "{" + "Excel,javascript:ContractExport(),_top} ";
|
||||||
|
RCMenuHeight += RCMenuHeightStep;
|
||||||
|
RCMenu += "{" + SystemEnv.getHtmlLabelName(18363, user.getLanguage()) + ",javascript:_table.firstPage(),_self}";
|
||||||
|
RCMenuHeight += RCMenuHeightStep;
|
||||||
|
RCMenu += "{" + SystemEnv.getHtmlLabelName(1258, user.getLanguage()) + ",javascript:_table.prePage(),_self}";
|
||||||
|
RCMenuHeight += RCMenuHeightStep;
|
||||||
|
RCMenu += "{" + SystemEnv.getHtmlLabelName(1259, user.getLanguage()) + ",javascript:_table.nextPage(),_self}";
|
||||||
|
RCMenuHeight += RCMenuHeightStep;
|
||||||
|
RCMenu += "{" + SystemEnv.getHtmlLabelName(18362, user.getLanguage()) + ",javascript:_table.lastPage(),_self}";
|
||||||
|
RCMenuHeight += RCMenuHeightStep;
|
||||||
|
%>
|
||||||
|
<%
|
||||||
|
int pagenum = Util.getIntValue(request.getParameter("pagenum"), 1);
|
||||||
|
int perpage = Util.getPerpageLog();
|
||||||
|
if (perpage <= 1) perpage = 10;
|
||||||
|
|
||||||
|
String creator = Util.fromScreen(request.getParameter("creator"), user.getLanguage());
|
||||||
|
String fromdate = Util.fromScreen(request.getParameter("fromdate"), user.getLanguage());
|
||||||
|
String fromdate2 = Util.fromScreen(request.getParameter("fromdate2"), user.getLanguage());
|
||||||
|
String enddate = Util.fromScreen(request.getParameter("enddate"), user.getLanguage());
|
||||||
|
String enddate2 = Util.fromScreen(request.getParameter("enddate2"), user.getLanguage());
|
||||||
|
String status_temp = Util.null2String(request.getParameter("status_temp"));
|
||||||
|
|
||||||
|
String conNo = Util.fromScreen(request.getParameter("conNo"), user.getLanguage());
|
||||||
|
String prNo = Util.fromScreen(request.getParameter("prNo"), user.getLanguage());
|
||||||
|
String jpcNo = Util.fromScreen(request.getParameter("jpcNo"), user.getLanguage());
|
||||||
|
String suppliersId = Util.fromScreen(request.getParameter("suppliersId"), user.getLanguage());
|
||||||
|
String isOneSuppliers = Util.fromScreen(request.getParameter("isOneSuppliers"), user.getLanguage());
|
||||||
|
// String reqDeptId = String.valueOf(user.getUserDepartment());
|
||||||
|
String reqDeptId = Util.fromScreen(request.getParameter("reqDeptId"), user.getLanguage());;
|
||||||
|
//管理员组或采购部才能查询所有部门下合同,合同接收人查看接收的合同
|
||||||
|
// if(HrmUserVarify.checkUserRight("ContactInfo:Manager", user) || isShow) reqDeptId = Util.fromScreen(request.getParameter("reqDeptId"), user.getLanguage());
|
||||||
|
String isOverdue = Util.fromScreen(request.getParameter("isOverdue"), user.getLanguage());
|
||||||
|
String status = Util.fromScreen(request.getParameter("status"), user.getLanguage());
|
||||||
|
String isOverdueNext = Util.fromScreen(request.getParameter("isOverdueNext"), user.getLanguage());
|
||||||
|
String conType = Util.fromScreen(request.getParameter("conType"), user.getLanguage());
|
||||||
|
|
||||||
|
String name = Util.fromScreen(request.getParameter("name"), user.getLanguage());
|
||||||
|
String subCompanyId = Util.fromScreen(request.getParameter("subCompanyId"), user.getLanguage());
|
||||||
|
String reNewStatus = Util.fromScreen(request.getParameter("reNewStatus"), user.getLanguage());
|
||||||
|
String conStatus = Util.fromScreen(request.getParameter("conStatus"), user.getLanguage());
|
||||||
|
String contractName = Util.fromScreen(request.getParameter("contractName"), user.getLanguage());
|
||||||
|
String csstatus = Util.fromScreen(request.getParameter("csstatus"), user.getLanguage());
|
||||||
|
|
||||||
|
int opentype = Util.getIntValue(request.getParameter("opentype"),-1);
|
||||||
|
|
||||||
|
//String sqlwhere = " where status = '' ";
|
||||||
|
//if(!"".equals(status_temp)) sqlwhere += " and status in ("+status_temp+") ";
|
||||||
|
|
||||||
|
if (!fromdate.equals("")) sqlwhere += " and startDate>='" + fromdate + "'";
|
||||||
|
if (!fromdate2.equals("")) sqlwhere += " and startDate<='" + fromdate2 + "'";
|
||||||
|
if (!enddate.equals("")) sqlwhere += " and enddate>='" + enddate + "'";
|
||||||
|
if (!enddate2.equals("")) sqlwhere += " and enddate<='" + enddate2 + "'";
|
||||||
|
if (!conNo.equals("")) sqlwhere += " and conNo like '%" + conNo + "%'";
|
||||||
|
if (!prNo.equals("")) sqlwhere += " and prNo='" + prNo + "'";
|
||||||
|
if (!jpcNo.equals("")) sqlwhere += " and jpcNo='" + jpcNo + "'";
|
||||||
|
if(!"".equals(suppliersId)) sqlwhere += " and suppliersId=" + suppliersId;
|
||||||
|
if (!isOneSuppliers.equals("")) sqlwhere += " and isOneSuppliers='" + isOneSuppliers + "'";
|
||||||
|
if (!"".equals(creator) && !"0".equals(creator)) sqlwhere += " and CrmContractInfo.creator=" + creator;
|
||||||
|
if (!reqDeptId.equals("")) sqlwhere += " and reqDeptId=" + reqDeptId;
|
||||||
|
if (!isOverdue.equals("")) sqlwhere += " and isOverdue='" + isOverdue + "'";
|
||||||
|
if (!status.equals("")) sqlwhere += " and CrmContractInfo.status='" + status + "'";
|
||||||
|
if (!isOverdueNext.equals("")) sqlwhere += " and isOverdueNext='" + isOverdueNext + "'";
|
||||||
|
if (!conType.equals("")) sqlwhere += " and conType='" + conType + "'";
|
||||||
|
if (!csstatus.equals("")) sqlwhere += " and CrmSalesContractInfo.status='" + csstatus + "'";
|
||||||
|
|
||||||
|
if (!name.equals("")) sqlwhere += " and name like '%" + name + "%'";
|
||||||
|
if (!subCompanyId.equals("")) sqlwhere += " and CrmContractInfo.subcompanyid1 = '" + subCompanyId + "'";
|
||||||
|
if (!reNewStatus.equals("")) sqlwhere += " and conStatus = '" + reNewStatus + "'";
|
||||||
|
|
||||||
|
if (!contractName.equals("")) sqlwhere += " and contractName like '%" + contractName + "%'";
|
||||||
|
|
||||||
|
//if (reNewStatus2.equals("待续签")) sqlwhere += " and dbo.getReNewStatus2(2,CrmContractInfo.saleContract) > 0";
|
||||||
|
//else if (reNewStatus2.equals("已续签")) sqlwhere += " and dbo.getReNewStatus2(1,CrmContractInfo.saleContract) > 0";
|
||||||
|
//else if (reNewStatus2.equals("无需续签")) sqlwhere += " and dbo.getReNewStatus2(3,CrmContractInfo.saleContract) > 0";
|
||||||
|
//System.out.println("sqlwhere:"+sqlwhere);
|
||||||
|
|
||||||
|
|
||||||
|
if(opentype > -1){
|
||||||
|
sqlwhere += " and isnull(CrmContractInfo.opentype,0) = " + opentype;
|
||||||
|
}
|
||||||
|
|
||||||
|
String orderStr = " order by startDate desc, CrmContractInfo.id desc ";
|
||||||
|
|
||||||
|
// out.println("sqlwhere:" + sqlwhere);
|
||||||
|
// out.println("orderStr:" + orderStr);
|
||||||
|
|
||||||
|
// session.setAttribute("sqlwhere", sqlwhere);
|
||||||
|
// session.setAttribute("orderStr", orderStr);
|
||||||
|
%>
|
||||||
|
<form id=frmmain name=frmmain method=post action="ContractList.jsp">
|
||||||
|
<input type=hidden id=pagenum name=pagenum value="<%=pagenum%>">
|
||||||
|
<input type=hidden id=status_temp name=status_temp value="">
|
||||||
|
<table class=ViewForm>
|
||||||
|
<tbody>
|
||||||
|
<COLGROUP>
|
||||||
|
<COL width="13%">
|
||||||
|
<COL width="20%">
|
||||||
|
<COL width="14%">
|
||||||
|
<COL width="20%">
|
||||||
|
<COL width="13%">
|
||||||
|
<COL width="20%">
|
||||||
|
<TR class=Title>
|
||||||
|
<TH colSpan=6><%=SystemEnv.getHtmlLabelName(15774, user.getLanguage())%></TH>
|
||||||
|
</TR>
|
||||||
|
<tr style="height: 1px">
|
||||||
|
<td class=Line1 colspan=6></td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<tr style="height: 1px">
|
||||||
|
<td class=Line colspan=6></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<TD>合同状态</TD>
|
||||||
|
<TD class=Field>
|
||||||
|
<select id="reNewStatus" name="reNewStatus">
|
||||||
|
<option value="" <%="".equals(reNewStatus)?"selected":""%>></option>
|
||||||
|
<option value="0" <%="0".equals(reNewStatus)?"selected":""%>>执行</option>
|
||||||
|
<option value="1" <%="1".equals(reNewStatus)?"selected":""%>>待续签</option>
|
||||||
|
<option value="2" <%="2".equals(reNewStatus)?"selected":""%>>已续签</option>
|
||||||
|
<option value="3" <%="3".equals(reNewStatus)?"selected":""%>>关闭</option>
|
||||||
|
</select>
|
||||||
|
</TD>
|
||||||
|
<td><%=SystemEnv.getHtmlLabelName(1970, user.getLanguage())%></td>
|
||||||
|
<td class=field>
|
||||||
|
<BUTTON type="button" class=calendar id=SelectDate onclick=getDate('fromdatespan','fromdate')></BUTTON>
|
||||||
|
<SPAN id=fromdatespan><%=Util.toScreen(fromdate, user.getLanguage())%></SPAN> -
|
||||||
|
<BUTTON type="button" class=calendar id=SelectDate onclick=getDate('fromdate2span','fromdate2')></BUTTON>
|
||||||
|
<SPAN id=fromdate2span><%=Util.toScreen(fromdate2, user.getLanguage())%></SPAN>
|
||||||
|
<input type="hidden" name="fromdate" value=<%=fromdate%>>
|
||||||
|
<input type="hidden" name="fromdate2" value=<%=fromdate2%>>
|
||||||
|
</td>
|
||||||
|
<td><%=SystemEnv.getHtmlLabelName(15236, user.getLanguage())%></td>
|
||||||
|
<td class=field>
|
||||||
|
<BUTTON type="button" class=calendar id=SelectDate onclick=getDate('enddatespan','enddate')></BUTTON>
|
||||||
|
<SPAN id=enddatespan><%=Util.toScreen(enddate, user.getLanguage())%></SPAN> -
|
||||||
|
<BUTTON type="button" class=calendar id=SelectDate onclick=getDate('enddate2span','enddate2')></BUTTON>
|
||||||
|
<SPAN id=enddate2span><%=Util.toScreen(enddate2, user.getLanguage())%></SPAN>
|
||||||
|
<input type="hidden" name="enddate" value=<%=enddate%>>
|
||||||
|
<input type="hidden" name="enddate2" value=<%=enddate2%>>
|
||||||
|
</td>
|
||||||
|
</TR>
|
||||||
|
<tr style="height: 1px">
|
||||||
|
<td class=Line colspan=6></td>
|
||||||
|
</tr>
|
||||||
|
<TR>
|
||||||
|
<TD><%=SystemEnv.getHtmlLabelName(21282, user.getLanguage())%></TD>
|
||||||
|
<TD class=Field>
|
||||||
|
<INPUT class=InputStyle maxLength=100 id="conNo" name="conNo" STYLE="width:150" value="<%=conNo%>">
|
||||||
|
</TD>
|
||||||
|
<TD>PR<%=SystemEnv.getHtmlLabelName(403,user.getLanguage())%></TD>
|
||||||
|
<TD class=Field>
|
||||||
|
<INPUT class=InputStyle maxLength=100 id="prNo" name="prNo" STYLE="width:150" value="<%=prNo%>">
|
||||||
|
</TD>
|
||||||
|
<TD>JPC<%=SystemEnv.getHtmlLabelName(2171,user.getLanguage())%><%=SystemEnv.getHtmlLabelName(16992,user.getLanguage())%></TD>
|
||||||
|
<TD class=Field>
|
||||||
|
<INPUT class=InputStyle maxLength=100 id="jpcNo" name="jpcNo" STYLE="width:150" value="<%=jpcNo%>">
|
||||||
|
</TD>
|
||||||
|
</TR>
|
||||||
|
<tr style="height: 1px">
|
||||||
|
<td class=Line colspan=6></td>
|
||||||
|
</tr>
|
||||||
|
<TR>
|
||||||
|
<TD><%=SystemEnv.getHtmlLabelName(613002, user.getLanguage())%></TD>
|
||||||
|
<TD class=Field>
|
||||||
|
<brow:browser viewType="0"
|
||||||
|
id="suppliersId"
|
||||||
|
name="suppliersId"
|
||||||
|
browserValue="<%=suppliersId %>"
|
||||||
|
browserUrl="/systeminfo/BrowserMain.jsp?url=/interface/CommonBrowser.jsp?type=browser.gys"
|
||||||
|
hasInput="true"
|
||||||
|
isSingle="true"
|
||||||
|
hasBrowser = "true"
|
||||||
|
isMustInput='1'
|
||||||
|
width="165px"
|
||||||
|
browserSpanValue="<%=CrmSupplierComInfo.getSuppliername(suppliersId) %>">
|
||||||
|
</brow:browser>
|
||||||
|
</TD>
|
||||||
|
<TD></TD>
|
||||||
|
<TD class=Field>
|
||||||
|
|
||||||
|
</TD>
|
||||||
|
<TD><%=SystemEnv.getHtmlLabelName(913, user.getLanguage())%></TD>
|
||||||
|
<TD class=Field>
|
||||||
|
<brow:browser viewType="0"
|
||||||
|
id="creator"
|
||||||
|
name="creator"
|
||||||
|
browserValue="<%=creator %>"
|
||||||
|
browserUrl="/systeminfo/BrowserMain.jsp?url=/hrm/resource/ResourceBrowser.jsp"
|
||||||
|
hasInput="true"
|
||||||
|
isSingle="true"
|
||||||
|
hasBrowser = "true"
|
||||||
|
isMustInput='1'
|
||||||
|
width="165px"
|
||||||
|
browserSpanValue="<%=ResourceComInfo.getResourcename(creator) %>">
|
||||||
|
</brow:browser>
|
||||||
|
</TD>
|
||||||
|
</TR>
|
||||||
|
<tr style="height: 1px">
|
||||||
|
<td class=Line colspan=6></td>
|
||||||
|
</tr>
|
||||||
|
<TR>
|
||||||
|
<TD><%=SystemEnv.getHtmlLabelName(620002, user.getLanguage())%></TD>
|
||||||
|
<TD class=Field>
|
||||||
|
|
||||||
|
<brow:browser viewType="0"
|
||||||
|
id="reqDeptId"
|
||||||
|
name="reqDeptId"
|
||||||
|
browserValue="<%=reqDeptId %>"
|
||||||
|
browserUrl="/systeminfo/BrowserMain.jsp?url=/hrm/company/DepartmentBrowser.jsp"
|
||||||
|
hasInput="true"
|
||||||
|
isSingle="true"
|
||||||
|
hasBrowser = "true"
|
||||||
|
isMustInput='1'
|
||||||
|
width="165px"
|
||||||
|
browserSpanValue="<%=Util.toScreen(DepartmentComInfo.getDepartmentname(reqDeptId),user.getLanguage())%>">
|
||||||
|
</brow:browser>
|
||||||
|
|
||||||
|
<%-- <%--%>
|
||||||
|
<%-- //管理员组才能查询所有部门下合同--%>
|
||||||
|
<%-- if(HrmUserVarify.checkUserRight("ContactInfo:Manager", user)){--%>
|
||||||
|
<%-- %>--%>
|
||||||
|
<%-- <brow:browser viewType="0"--%>
|
||||||
|
<%-- id="reqDeptId"--%>
|
||||||
|
<%-- name="reqDeptId"--%>
|
||||||
|
<%-- browserValue="<%=reqDeptId %>"--%>
|
||||||
|
<%-- browserUrl="/systeminfo/BrowserMain.jsp?url=/hrm/company/DepartmentBrowser.jsp"--%>
|
||||||
|
<%-- hasInput="true"--%>
|
||||||
|
<%-- isSingle="true"--%>
|
||||||
|
<%-- hasBrowser = "true"--%>
|
||||||
|
<%-- isMustInput='1'--%>
|
||||||
|
<%-- width="165px"--%>
|
||||||
|
<%-- browserSpanValue="<%=Util.toScreen(DepartmentComInfo.getDepartmentname(reqDeptId),user.getLanguage())%>">--%>
|
||||||
|
<%-- </brow:browser>--%>
|
||||||
|
|
||||||
|
<%-- <%–<INPUT type=hidden class="wuiBrowser" _required="no" _displayTemplate="#b{name}" _displayText="<%=Util.toScreen(DepartmentComInfo.getDepartmentname(reqDeptId),user.getLanguage()) %>" _url="/systeminfo/BrowserMain.jsp?url=/hrm/company/DepartmentBrowser.jsp" name="reqDeptId" value="<%=reqDeptId%>">–%>--%>
|
||||||
|
<%-- <%}else{ %>--%>
|
||||||
|
<%-- <%=Util.toScreen(DepartmentComInfo.getDepartmentname(reqDeptId),user.getLanguage()) %>--%>
|
||||||
|
<%-- <%} %>--%>
|
||||||
|
</TD>
|
||||||
|
<TD>付款状态</TD>
|
||||||
|
<TD class=Field>
|
||||||
|
<select id="status" name="status">
|
||||||
|
<option value="" <%="".equals(status)?"selected":""%>></option>
|
||||||
|
<option value="0" <%="0".equals(status)?"selected":""%>>执行中</option>
|
||||||
|
<option value="1" <%="1".equals(status)?"selected":""%>>已结清</option>
|
||||||
|
</select>
|
||||||
|
</TD>
|
||||||
|
<TD><%=SystemEnv.getHtmlLabelName(620017, user.getLanguage())%></TD>
|
||||||
|
<TD class=Field>
|
||||||
|
<select id="isOverdueNext" name="isOverdueNext">
|
||||||
|
<option value="" <%="".equals(isOverdueNext)?"selected":""%>></option>
|
||||||
|
<option value="Y" <%="Y".equals(isOverdueNext)?"selected":""%>><%=SystemEnv.getHtmlLabelName(163,user.getLanguage())%></option>
|
||||||
|
<option value="N" <%="N".equals(isOverdueNext)?"selected":""%>><%=SystemEnv.getHtmlLabelName(161,user.getLanguage())%></option>
|
||||||
|
</select>
|
||||||
|
</TD>
|
||||||
|
</TR>
|
||||||
|
<tr style="height: 1px">
|
||||||
|
<td class=Line colspan=6></td>
|
||||||
|
</tr>
|
||||||
|
<TR>
|
||||||
|
<TD><%=SystemEnv.getHtmlLabelName(15775, user.getLanguage())%></TD>
|
||||||
|
<TD class=Field>
|
||||||
|
<select id="conType" name="conType">
|
||||||
|
<option value="" <%="".equals(conType)?"selected":""%>></option>
|
||||||
|
<option value="0" <%="0".equals(conType)?"selected":""%>>业务型</option>
|
||||||
|
<option value="1" <%="1".equals(conType)?"selected":""%>>资本型</option>
|
||||||
|
<option value="2" <%="2".equals(conType)?"selected":""%>>费用型</option>
|
||||||
|
</select>
|
||||||
|
</TD>
|
||||||
|
<TD><%=SystemEnv.getHtmlLabelName(15142, user.getLanguage())%></TD>
|
||||||
|
<TD class=Field>
|
||||||
|
<INPUT class=InputStyle maxLength=200 id="name" name="name" STYLE="width:150" value="<%=name%>">
|
||||||
|
</TD>
|
||||||
|
<%if(HrmUserVarify.checkUserRight("ContactInfoList:ALL", user)){%>
|
||||||
|
<TD><%=SystemEnv.getHtmlLabelName(141,user.getLanguage())%>:</TD>
|
||||||
|
<TD class=Field>
|
||||||
|
|
||||||
|
|
||||||
|
<brow:browser viewType="0"
|
||||||
|
id="subCompanyId"
|
||||||
|
name="subCompanyId"
|
||||||
|
browserValue="<%=subCompanyId %>"
|
||||||
|
browserUrl="/systeminfo/BrowserMain.jsp?url=/hrm/company/SubcompanyBrowser.jsp"
|
||||||
|
hasInput="true"
|
||||||
|
isSingle="true"
|
||||||
|
hasBrowser = "true"
|
||||||
|
isMustInput='1'
|
||||||
|
width="165px"
|
||||||
|
browserSpanValue="<%=SubCompanyComInfo.getSubCompanyname(subCompanyId+"")%>">
|
||||||
|
</brow:browser>
|
||||||
|
|
||||||
|
|
||||||
|
<%--<input class=wuiBrowser class=inputStyle id=subCompanyId type=hidden name=subCompanyId value="<%=subCompanyId%>"--%>
|
||||||
|
<%--_url="/systeminfo/BrowserMain.jsp?url=/hrm/company/SubcompanyBrowser.jsp"--%>
|
||||||
|
<%--_displayText="<%=SubCompanyComInfo.getSubCompanyname(subCompanyId+"")%>"--%>
|
||||||
|
<%-->--%>
|
||||||
|
</TD>
|
||||||
|
<%}%>
|
||||||
|
</TR>
|
||||||
|
<tr style="height: 1px">
|
||||||
|
<td class=Line colspan=6></td>
|
||||||
|
</tr>
|
||||||
|
<TR>
|
||||||
|
<TD><%=SystemEnv.getHtmlLabelName(16404, user.getLanguage())%><%=SystemEnv.getHtmlLabelName(195, user.getLanguage())%></TD>
|
||||||
|
<TD class=Field>
|
||||||
|
<INPUT class=InputStyle maxLength=200 id="contractName" name="contractName" STYLE="width:150" value="<%=contractName%>">
|
||||||
|
</TD>
|
||||||
|
<TD>销售合同状态</TD>
|
||||||
|
<TD class=Field>
|
||||||
|
<select id="csstatus" name="csstatus">
|
||||||
|
<option value="" <%="".equals(csstatus)?"selected":""%>></option>
|
||||||
|
<option value="0" <%="0".equals(csstatus)?"selected":""%>>已签署</option>
|
||||||
|
<option value="1" <%="1".equals(csstatus)?"selected":""%>>未签署</option>
|
||||||
|
<option value="2" <%="2".equals(csstatus)?"selected":""%>>已续签</option>
|
||||||
|
<option value="3" <%="3".equals(csstatus)?"selected":""%>>关闭</option>
|
||||||
|
</select>
|
||||||
|
</TD>
|
||||||
|
<td>开闭口类型</td>
|
||||||
|
<td class="Field">
|
||||||
|
<select name="opentype">
|
||||||
|
<option value="-1" <%=(opentype == -1) ?"selected":"" %>>--请选择--</option>
|
||||||
|
<option value="0" <%=(opentype == 0) ?"selected":"" %>>闭口</option>
|
||||||
|
<option value="1" <%=(opentype == 1) ?"selected":"" %>>开口</option>
|
||||||
|
<option value="2" <%=(opentype == 2) ?"selected":"" %>>周期性</option>
|
||||||
|
</select>
|
||||||
|
</td>
|
||||||
|
</TR>
|
||||||
|
<tr style="height: 1px">
|
||||||
|
<td class=Line colspan=6></td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
</form>
|
||||||
|
|
||||||
|
<div id="" style="overflow-x:scroll;width:100%;">
|
||||||
|
<table width="2500px" style="table-Layout:fixed">
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<%
|
||||||
|
|
||||||
|
String tableString = "";
|
||||||
|
String backfields = " CrmContractInfo.id,case CrmContractInfo.opentype when '0' then '闭口' when '1' then '开口' when '2' then '周期性' end opentype, reqDeptId, suppliersId, conNo, name, startDate, endDate, case isOverdue when 'Y' then '是' else '否' end as isOverdue, conAmount, content, ',' as str_temp, case isOverdueNext when 'Y' then '是' else '否' end as isOverdueNext, case CrmContractInfo.status when '0' then '执行中' when '1' then '已结清' end as status, CrmContractInfo.creator, CrmContractInfo.subcompanyid1, case conStatus when '0' then '执行' when '1' then '待续签' when '2' then '已续签' when '3' then '关闭' end as reNewStatus, contractName, saleContract, case when dbo.getReNewStatus2(1,CrmContractInfo.saleContract) > 0 then '已续签' when dbo.getReNewStatus2(2,CrmContractInfo.saleContract) > 0 then '待续签' when dbo.getReNewStatus2(3,CrmContractInfo.saleContract) > 0 then '无需续签' end as reNewStatus2,case CrmSalesContractInfo.status when '0' then '已签署' when '1' then '未签署' when '2' then '已续签' when '3' then '关闭' end as csstatus ";
|
||||||
|
String fromSql = " CrmContractInfo Left Join CrmSalesContractInfo On CrmSalesContractInfo.id=CrmContractInfo.saleContract ";
|
||||||
|
//out.print("select"+backfields+"from"+fromSql +sqlwhere);
|
||||||
|
String str_content = "content"+"str_temp";
|
||||||
|
tableString = " <table instanceid=\"crmContractInfoTable\" tabletype=\"none\" pageId=\"perpage\" pagesize=\"" +PageIdConst.getPageSize("perpage",user.getUID())+"\" >" + "<sql backfields=\"" + backfields + "\" sqlform=\"" + fromSql + "\" sqlwhere=\"" + Util.toHtmlForSplitPage(sqlwhere) + "\" sqlprimarykey=\"CrmContractInfo.id\" sqlsortway=\"Desc\" sqlisdistinct=\"false\" />" + "<head>";
|
||||||
|
tableString += "<col width=\"10%\" text=\"" + SystemEnv.getHtmlLabelName(15142, user.getLanguage()) + "\" column=\"name\" orderkey=\"name\" linkkey=\"id\" linkvaluecolumn=\"id\" href=\"/CRM/contractinfo/ContractEdit.jsp\" target=\"_fullwindow\" />";
|
||||||
|
tableString += "<col width=\"10%\" text=\"" + SystemEnv.getHtmlLabelName(21282, user.getLanguage()) + "\" column=\"conNo\" orderkey=\"conNo\" />";
|
||||||
|
tableString += "<col width=\"10%\" text=\"" + SystemEnv.getHtmlLabelName(620002, user.getLanguage()) + "\" column=\"reqDeptId\" orderkey=\"reqDeptId\" transmethod=\"weaver.hrm.company.DepartmentComInfo.getDepartmentname\" linkkey=\"id\" href=\"/hrm/company/HrmDepartmentDsp.jsp\" target=\"_fullwindow\" />";
|
||||||
|
tableString += "<col width=\"10%\" text=\""+ SystemEnv.getHtmlLabelName(613002, user.getLanguage()) + "\" column=\"suppliersId\" orderkey=\"suppliersId\" linkkey=\"id\" transmethod=\"weaver.crm.supplierinfo.CrmSupplierComInfo.getSuppliername\" href=\"/CRM/supplierinfo/SuppliersEdit.jsp?1=1\" target=\"_fullwindow\" />";
|
||||||
|
tableString += "<col width=\"6%\" text=\"" + SystemEnv.getHtmlLabelName(1970, user.getLanguage()) + "\" column=\"startDate\" orderkey=\"startDate\" />";
|
||||||
|
tableString += "<col width=\"6%\" text=\"" + SystemEnv.getHtmlLabelName(15236, user.getLanguage()) + "\" column=\"endDate\" orderkey=\"endDate\" />";
|
||||||
|
//tableString += "<col width=\"3%\" text=\"" + SystemEnv.getHtmlLabelName(620016, user.getLanguage()) + "\" column=\"isOverdue\" orderkey=\"isOverdue\" />";
|
||||||
|
tableString += "<col width=\"6%\" text=\"" + SystemEnv.getHtmlLabelName(6146, user.getLanguage()) + "\" column=\"conAmount\" orderkey=\"conAmount\" />";
|
||||||
|
tableString += "<col width=\"10%\" text=\"" + SystemEnv.getHtmlLabelName(620015, user.getLanguage()) + "\" column=\"content\" orderkey=\""+str_content+"\" transmethod=\"weaver.splitepage.transform.SptmForDoc.getDocNames\" />";
|
||||||
|
tableString += "<col width=\"4%\" text=\"" + SystemEnv.getHtmlLabelName(620017, user.getLanguage()) + "\" column=\"isOverdueNext\" orderkey=\"isOverdueNext\" />";
|
||||||
|
tableString += "<col width=\"4%\" text=\"付款状态\" column=\"status\" orderkey=\"status\" />";
|
||||||
|
tableString += "<col width=\"4%\" text=\"" + SystemEnv.getHtmlLabelName(913, user.getLanguage()) + "\" column=\"creator\" orderkey=\"creator\" linkkey=\"id\" transmethod=\"weaver.hrm.resource.ResourceComInfo.getResourcename\" href=\"/hrm/resource/HrmResource.jsp?1=1\" target=\"_fullwindow\" />";
|
||||||
|
//tableString += "<col width=\"10%\" text=\"" + SystemEnv.getHtmlLabelName(104, user.getLanguage()) + "\" column=\"id\" orderkey=\"id\" transmethod=\"weaver.crm.contractinfo.CrmContractTool.getLinkButtons\" />";
|
||||||
|
tableString += "<col width=\"4%\" text=\"合同状态\" column=\"reNewStatus\" orderkey=\"reNewStatus\" />";
|
||||||
|
tableString += "<col width=\"4%\" text=\"销售合同\" column=\"contractName\" orderkey=\"contractName\" linkkey=\"id\" linkvaluecolumn=\"saleContract\" href=\"/CRM/salecontractinfo/SaleContractEdits.jsp?metherid=search\" target=\"_fullwindow\" />";
|
||||||
|
tableString += "<col width=\"4%\" text=\"销售合同状态\" column=\"csstatus\" orderkey=\"csstatus\" />";
|
||||||
|
tableString += "<col width=\"4%\" text=\"开闭口类型\" column=\"opentype\" orderkey=\"opentype\" />";
|
||||||
|
tableString += "<col width=\"4%\" text=\"" + SystemEnv.getHtmlLabelName(141,user.getLanguage()) + "\" column=\"subcompanyid1\" orderkey=\"subcompanyid1\" transmethod=\"weaver.hrm.company.SubCompanyComInfo.getSubCompanyname\" />";
|
||||||
|
tableString += "</head>";
|
||||||
|
tableString += "</table>";
|
||||||
|
%>
|
||||||
|
<input type="hidden" name="pageId" id="pageId" value="crmContractInfoTable" />
|
||||||
|
<wea:SplitPageTag tableString="<%=tableString%>" mode="run" />
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
<%@ include file="/systeminfo/RightClickMenu_wev8.jsp"%>
|
||||||
|
</body>
|
||||||
|
|
||||||
|
<iframe id="searchexport" style="display: none"></iframe>
|
||||||
|
<script language=javascript>
|
||||||
|
function ContractExport() {
|
||||||
|
console.log("contract export =====>sqlwhere:"+encodeURI("<%=sqlwhere%>")+" orderStr:"+encodeURI("<%=orderStr%>"));
|
||||||
|
var sqlwhere = encodeURI("<%=sqlwhere%>");
|
||||||
|
var orderStr = encodeURI("<%=orderStr%>");
|
||||||
|
|
||||||
|
jQuery("#searchexport").attr("src", "ContractReportExport.jsp?sqlwhere="+sqlwhere+"&orderStr=" + orderStr);
|
||||||
|
}
|
||||||
|
|
||||||
|
function OnSubmit(pagenum) {
|
||||||
|
document.frmmain.pagenum.value = pagenum;
|
||||||
|
document.frmmain.submit();
|
||||||
|
}
|
||||||
|
|
||||||
|
function OnSearch(){
|
||||||
|
var chkInTableTags = document.getElementsByName("status");
|
||||||
|
var status_temp = "";
|
||||||
|
for(var i=0;i<chkInTableTags.length;i++){
|
||||||
|
if(chkInTableTags[i].checked && chkInTableTags[i].value != ''){
|
||||||
|
if(status_temp == "") status_temp = "'" + chkInTableTags[i].value + "'";
|
||||||
|
else status_temp = status_temp + ",'" + chkInTableTags[i].value + "'";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
jQuery("#status_temp").val(status_temp);
|
||||||
|
document.frmmain.submit();
|
||||||
|
}
|
||||||
|
|
||||||
|
//续签
|
||||||
|
function newWorkflowByContract4(key){
|
||||||
|
location.href = "ContractNewWorkflow.jsp?status=4&id="+key;
|
||||||
|
}
|
||||||
|
|
||||||
|
//试运作
|
||||||
|
function newWorkflowByContract3(key){
|
||||||
|
location.href = "ContractNewWorkflow.jsp?status=3&id="+key;
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
<SCRIPT language="javascript" src="/js/datetime_wev8.js"></script>
|
||||||
|
<SCRIPT language="javascript" src="/js/JSDateTime/WdatePicker_wev8.js"></script>
|
||||||
|
</html>
|
|
@ -0,0 +1,130 @@
|
||||||
|
<%@ page language="java" contentType="text/html; charset=GBK" %>
|
||||||
|
<%@ include file="/systeminfo/init.jsp" %>
|
||||||
|
<%@ page import="weaver.general.Util, weaver.file.ExcelSheet, weaver.file.ExcelRow" %>
|
||||||
|
<%@ page import="lombok.val" %>
|
||||||
|
<%@ page import="weaver.zwl.common.logging.Logger" %>
|
||||||
|
|
||||||
|
<jsp:useBean id="RecordSet" class="weaver.conn.RecordSet" scope="page"/>
|
||||||
|
<jsp:useBean id="ResourceComInfo" class="weaver.hrm.resource.ResourceComInfo" scope="page"/>
|
||||||
|
<jsp:useBean id="SptmForDoc" class="weaver.splitepage.transform.SptmForDoc" scope="page"/>
|
||||||
|
<jsp:useBean id="SubCompanyComInfo" class="weaver.hrm.company.SubCompanyComInfo" scope="page"/>
|
||||||
|
<jsp:useBean id="DepartmentComInfo" class="weaver.hrm.company.DepartmentComInfo" scope="page"/>
|
||||||
|
<jsp:useBean id="CrmSupplierComInfo" class="weaver.crm.supplierinfo.CrmSupplierComInfo" scope="page"/>
|
||||||
|
<jsp:useBean id="RequestComInfo" class="weaver.workflow.request.RequestComInfo" scope="page"/>
|
||||||
|
<jsp:useBean id="DocComInfo" class="weaver.docs.docs.DocComInfo" scope="page"/>
|
||||||
|
<jsp:useBean id="ExcelFile" class="weaver.file.ExcelFile" scope="session"/>
|
||||||
|
<%!
|
||||||
|
public static String ToDBC(String input) {
|
||||||
|
char[] c = input.toCharArray();
|
||||||
|
for (int i = 0; i < c.length; i++) {
|
||||||
|
if (c[i] == 12288) {
|
||||||
|
//全角空格为12288,半角空格为32
|
||||||
|
c[i] = (char) 32;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (c[i] > 65280 && c[i] < 65375)
|
||||||
|
//其他字符半角(33-126)与全角(65281-65374)的对应关系是:均相差65248
|
||||||
|
c[i] = (char) (c[i] - 65248);
|
||||||
|
}
|
||||||
|
return new String(c);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
%>
|
||||||
|
|
||||||
|
<%
|
||||||
|
// String sqlwhere=(String)session.getAttribute("sqlwhere");
|
||||||
|
// String orderStr=(String)session.getAttribute("orderStr");
|
||||||
|
|
||||||
|
val logger = aiyh.utils.Util.getLogger();
|
||||||
|
String sqlwhere = request.getParameter("sqlwhere");
|
||||||
|
sqlwhere = ToDBC(sqlwhere);
|
||||||
|
String orderStr = request.getParameter("orderStr");
|
||||||
|
orderStr = ToDBC(orderStr);
|
||||||
|
|
||||||
|
String sqlstr = "";
|
||||||
|
|
||||||
|
if (RecordSet.getDBType().equals("oracle")) {
|
||||||
|
sqlstr = "select CrmContractInfo.id, reqDeptId, suppliersId, conNo, name, startDate, endDate, case isOverdue when 'Y' then '是' else '否' end as isOverdue, conAmount, content, case isOverdueNext when 'Y' then '是' else '否' end as isOverdueNext, case CrmContractInfo.status when '0' then '执行中' when '1' then '已结清' end as status, case isOneSuppliers when 'Y' then '是' when 'N' then '否' else '' end as isOneSuppliers, prRequestId,jpcNo,jpcFile,prNo,prAmount,prAmountSum,conAmount,managerId,subject,giveDate,giveRemark,payRemark,content,CrmContractInfo.createDate,CrmContractInfo.creator,CrmContractInfo.subcompanyid1, case conStatus when '0' then '执行' when '1' then '待续签' when '2' then '已续签' when '3' then '关闭' end as reNewStatus,contractName, saleContract, case CrmSalesContractInfo.status when '0' then '已签署' when '1' then '未签署' when '2' then '已续签' when '3' then '关闭' end as reNewStatus2 from CrmContractInfo Left Join CrmSalesContractInfo On CrmSalesContractInfo.id=CrmContractInfo.saleContract" + sqlwhere + orderStr;
|
||||||
|
} else {
|
||||||
|
sqlstr = "select CrmContractInfo.id, reqDeptId, suppliersId, conNo, name, startDate, endDate, case isOverdue when 'Y' then '是' else '否' end as isOverdue, conAmount, content, case isOverdueNext when 'Y' then '是' else '否' end as isOverdueNext, case CrmContractInfo.status when '0' then '执行中' when '1' then '已结清' end as status, case isOneSuppliers when 'Y' then '是' when 'N' then '否' else '' end as isOneSuppliers, prRequestId,jpcNo,jpcFile,prNo,prAmount,prAmountSum,conAmount,managerId,subject,giveDate,giveRemark,payRemark,content,CrmContractInfo.createDate,CrmContractInfo.creator,CrmContractInfo.subcompanyid1, case conStatus when '0' then '执行' when '1' then '待续签' when '2' then '已续签' when '3' then '关闭' end as reNewStatus,contractName, saleContract, case CrmSalesContractInfo.status when '0' then '已签署' when '1' then '未签署' when '2' then '已续签' when '3' then '关闭' end as reNewStatus2 from CrmContractInfo Left Join CrmSalesContractInfo On CrmSalesContractInfo.id=CrmContractInfo.saleContract" + sqlwhere + orderStr;
|
||||||
|
}
|
||||||
|
new BaseBean().writeLog(">>>>>>>>"+sqlstr);
|
||||||
|
RecordSet.executeQuery(sqlstr);
|
||||||
|
|
||||||
|
ExcelSheet es = new ExcelSheet();
|
||||||
|
|
||||||
|
ExcelRow er = es.newExcelRow();
|
||||||
|
er.addStringValue(SystemEnv.getHtmlLabelName(141,user.getLanguage()));
|
||||||
|
er.addStringValue(SystemEnv.getHtmlLabelName(620002,user.getLanguage()));
|
||||||
|
er.addStringValue(SystemEnv.getHtmlLabelName(613002,user.getLanguage()));
|
||||||
|
er.addStringValue(SystemEnv.getHtmlLabelName(21282,user.getLanguage()));
|
||||||
|
er.addStringValue(SystemEnv.getHtmlLabelName(15142,user.getLanguage()));
|
||||||
|
er.addStringValue(SystemEnv.getHtmlLabelName(1970,user.getLanguage()));
|
||||||
|
er.addStringValue(SystemEnv.getHtmlLabelName(15236,user.getLanguage()));
|
||||||
|
er.addStringValue(SystemEnv.getHtmlLabelName(620016,user.getLanguage()));
|
||||||
|
er.addStringValue(SystemEnv.getHtmlLabelName(6146,user.getLanguage()));
|
||||||
|
er.addStringValue(SystemEnv.getHtmlLabelName(620015,user.getLanguage()));
|
||||||
|
er.addStringValue(SystemEnv.getHtmlLabelName(620017,user.getLanguage()));
|
||||||
|
er.addStringValue("付款状态");
|
||||||
|
er.addStringValue(SystemEnv.getHtmlLabelName(913,user.getLanguage()));
|
||||||
|
er.addStringValue(SystemEnv.getHtmlLabelName(620009,user.getLanguage()));
|
||||||
|
er.addStringValue(SystemEnv.getHtmlLabelName(620003,user.getLanguage()));
|
||||||
|
er.addStringValue("JPC"+SystemEnv.getHtmlLabelName(16992,user.getLanguage()));
|
||||||
|
er.addStringValue(SystemEnv.getHtmlLabelName(620004,user.getLanguage()));
|
||||||
|
er.addStringValue("PR"+SystemEnv.getHtmlLabelName(403,user.getLanguage()));
|
||||||
|
er.addStringValue("PR"+SystemEnv.getHtmlLabelName(856,user.getLanguage()));
|
||||||
|
er.addStringValue(SystemEnv.getHtmlLabelName(620010,user.getLanguage()));
|
||||||
|
er.addStringValue(SystemEnv.getHtmlLabelName(620011,user.getLanguage()));
|
||||||
|
er.addStringValue(SystemEnv.getHtmlLabelName(620006,user.getLanguage()));
|
||||||
|
er.addStringValue(SystemEnv.getHtmlLabelName(620012,user.getLanguage()));
|
||||||
|
er.addStringValue(SystemEnv.getHtmlLabelName(620013,user.getLanguage()));
|
||||||
|
er.addStringValue(SystemEnv.getHtmlLabelName(620014,user.getLanguage()));
|
||||||
|
er.addStringValue(SystemEnv.getHtmlLabelName(620015,user.getLanguage()));
|
||||||
|
er.addStringValue(SystemEnv.getHtmlLabelName(614,user.getLanguage())+SystemEnv.getHtmlLabelName(722,user.getLanguage()));
|
||||||
|
er.addStringValue("合同状态");
|
||||||
|
er.addStringValue("销售合同");
|
||||||
|
er.addStringValue("销售合同状态");
|
||||||
|
|
||||||
|
while (RecordSet.next()) {
|
||||||
|
ExcelRow erdetail = es.newExcelRow();
|
||||||
|
erdetail.addStringValue(SubCompanyComInfo.getSubCompanyname(RecordSet.getString("subcompanyid1")));
|
||||||
|
erdetail.addStringValue(DepartmentComInfo.getDepartmentname(RecordSet.getString("reqDeptId")));
|
||||||
|
erdetail.addStringValue(CrmSupplierComInfo.getSuppliername(RecordSet.getString("suppliersId")));
|
||||||
|
erdetail.addStringValue(RecordSet.getString("conNo"));
|
||||||
|
erdetail.addStringValue(RecordSet.getString("name"));
|
||||||
|
erdetail.addStringValue(RecordSet.getString("startDate"));
|
||||||
|
erdetail.addStringValue(RecordSet.getString("endDate"));
|
||||||
|
erdetail.addStringValue(RecordSet.getString("isOverdue"));
|
||||||
|
erdetail.addStringValue(RecordSet.getString("conAmount"));
|
||||||
|
erdetail.addStringValue(Util.toScreen(SptmForDoc.getDocName(RecordSet.getString("content")), user.getLanguage()));
|
||||||
|
erdetail.addStringValue(RecordSet.getString("isOverdueNext"));
|
||||||
|
erdetail.addStringValue(RecordSet.getString("status"));
|
||||||
|
erdetail.addStringValue(Util.toScreen(ResourceComInfo.getResourcename(RecordSet.getString("creator")), user.getLanguage()));
|
||||||
|
erdetail.addStringValue(RecordSet.getString("isOneSuppliers"));
|
||||||
|
erdetail.addStringValue(RequestComInfo.getRequestname(RecordSet.getString("prRequestId")));
|
||||||
|
erdetail.addStringValue(RecordSet.getString("jpcNo"));
|
||||||
|
erdetail.addStringValue(DocComInfo.getDocname(RecordSet.getString("jpcFile")));
|
||||||
|
erdetail.addStringValue(RecordSet.getString("prNo"));
|
||||||
|
erdetail.addStringValue(RecordSet.getString("prAmount"));
|
||||||
|
erdetail.addStringValue(RecordSet.getString("prAmountSum"));
|
||||||
|
erdetail.addStringValue(ResourceComInfo.getResourcename(RecordSet.getString("managerId")));
|
||||||
|
erdetail.addStringValue(RecordSet.getString("subject"));
|
||||||
|
erdetail.addStringValue(RecordSet.getString("giveDate"));
|
||||||
|
erdetail.addStringValue(RecordSet.getString("giveRemark"));
|
||||||
|
erdetail.addStringValue(RecordSet.getString("payRemark"));
|
||||||
|
erdetail.addStringValue(DocComInfo.getDocname(RecordSet.getString("content")));
|
||||||
|
erdetail.addStringValue(RecordSet.getString("createDate"));
|
||||||
|
erdetail.addStringValue(RecordSet.getString("reNewStatus"));
|
||||||
|
erdetail.addStringValue(RecordSet.getString("contractName"));
|
||||||
|
erdetail.addStringValue(RecordSet.getString("reNewStatus2"));
|
||||||
|
}
|
||||||
|
|
||||||
|
ExcelFile.init();
|
||||||
|
ExcelFile.setFilename("合同报表");
|
||||||
|
ExcelFile.addSheet("合同", es);
|
||||||
|
%>
|
||||||
|
<%--<iframe name="ExcelOut" id="ExcelOut" src="/weaver/weaver.file.ExcelOut" style="display:none" ></iframe>--%>
|
||||||
|
<script language="javascript">
|
||||||
|
window.location = "/weaver/weaver.file.ExcelOut";
|
||||||
|
</script>
|
|
@ -116,6 +116,31 @@ public class FaRequestUtils {
|
||||||
}
|
}
|
||||||
return responeVo;
|
return responeVo;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 公司认证状态同步方法
|
||||||
|
*
|
||||||
|
* @param data 请求参数
|
||||||
|
* @param url 请求地址
|
||||||
|
* @return 请求结果
|
||||||
|
*/
|
||||||
|
public static ResponeVo companyAuthentication(Map<String, Object> data, String url) {
|
||||||
|
log.info("公司认证状态同步");
|
||||||
|
try {
|
||||||
|
HEADER.put("sign", builderSign(data));
|
||||||
|
} catch (Exception e) {
|
||||||
|
throw new CustomerException("签名失败!", e);
|
||||||
|
}
|
||||||
|
HEADER.put("Content-Type", "application/json");
|
||||||
|
ResponeVo responeVo = null;
|
||||||
|
try {
|
||||||
|
responeVo = HTTP_UTILS.apiPost(url,
|
||||||
|
data, null);
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
return responeVo;
|
||||||
|
}
|
||||||
|
|
||||||
public static ResponeVo RevocationContract(Map<String, Object> data, String url) {
|
public static ResponeVo RevocationContract(Map<String, Object> data, String url) {
|
||||||
log.info("撤销合同方法");
|
log.info("撤销合同方法");
|
||||||
|
|
|
@ -130,6 +130,7 @@ public class BaseTest {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void with() {
|
public void with() {
|
||||||
|
|
||||||
Logger logger = Util.getLogger();
|
Logger logger = Util.getLogger();
|
||||||
logger.info("aafasdf");
|
logger.info("aafasdf");
|
||||||
String sql = "select COMPANYNAME,LICENSE,EXPIREDATE,CVERSION from license ";
|
String sql = "select COMPANYNAME,LICENSE,EXPIREDATE,CVERSION from license ";
|
||||||
|
|
|
@ -22,6 +22,9 @@ import org.apache.poi.ss.usermodel.Workbook;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import weaver.bokang.xiao.common.mapper.ModeMapper;
|
import weaver.bokang.xiao.common.mapper.ModeMapper;
|
||||||
import weaver.bokang.xiao.deg_repeat_check.action.RepeatCheckAction;
|
import weaver.bokang.xiao.deg_repeat_check.action.RepeatCheckAction;
|
||||||
|
import weaver.bokang.xiao.porsche.action.DateFieldUpdateAction;
|
||||||
|
import weaver.bokang.xiao.porsche.schedule.CompanyWriteBackSchedule;
|
||||||
|
import weaver.bokang.xiao.sh_bigdata.action.DataPushAction;
|
||||||
import weaver.bokang.xiao.xhny_mode.search.CustomSearchDepart;
|
import weaver.bokang.xiao.xhny_mode.search.CustomSearchDepart;
|
||||||
import weaver.bokang.xiao.xhny_report.entity.SourceTrackingData;
|
import weaver.bokang.xiao.xhny_report.entity.SourceTrackingData;
|
||||||
import weaver.bokang.xiao.xhny_report.schedule.GenerateReportSchedule;
|
import weaver.bokang.xiao.xhny_report.schedule.GenerateReportSchedule;
|
||||||
|
@ -44,6 +47,7 @@ import java.io.*;
|
||||||
import java.lang.reflect.Constructor;
|
import java.lang.reflect.Constructor;
|
||||||
import java.lang.reflect.InvocationTargetException;
|
import java.lang.reflect.InvocationTargetException;
|
||||||
import java.sql.*;
|
import java.sql.*;
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
|
@ -57,9 +61,9 @@ public class NormalTest extends BaseTest {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testWord(){
|
public void testWord(){
|
||||||
//GenerateFileUtil.createCronJobDocument(GenerateReportSchedule.class);
|
//GenerateFileUtil.createCronJobDocument(CompanyWriteBackSchedule.class);
|
||||||
//GenerateFileUtil.createActionDocument(OneNetComAction.class);
|
GenerateFileUtil.createActionDocument(DataPushAction.class);
|
||||||
GenerateFileUtil.createActionDocument(RepeatSubmitAction.class);
|
//GenerateFileUtil.createActionDocument(DateFieldUpdateAction.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
@ -348,4 +352,12 @@ public class NormalTest extends BaseTest {
|
||||||
System.out.println(sourceStr.contains(value));
|
System.out.println(sourceStr.contains(value));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testDate(){
|
||||||
|
Date date = new Date();
|
||||||
|
SimpleDateFormat sdf = new SimpleDateFormat("MMMM d','yyyy",Locale.US);
|
||||||
|
String formattedDate = sdf.format(date);
|
||||||
|
System.out.println("Formatted date: " + formattedDate);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue