Compare commits

..

No commits in common. "d77652482467ad1099e30fc9561e3023fe0cbe6e" and "50b8582287a11014f71a29fad1b1a0f37b586498" have entirely different histories.

7 changed files with 120 additions and 101 deletions

View File

@ -20,7 +20,6 @@ import java.util.List;
* @author EBU7-dev1-ayh create 2021/12/19 0019 14:39 * @author EBU7-dev1-ayh create 2021/12/19 0019 14:39
*/ */
@SuppressWarnings("all")
public class RecordsetUtil implements InvocationHandler { public class RecordsetUtil implements InvocationHandler {

View File

@ -27,54 +27,54 @@ import java.util.Objects;
@ActionDesc(value = "定时查询发票勾选状态", author = "bokang.xiao") @ActionDesc(value = "定时查询发票勾选状态", author = "bokang.xiao")
public class InvoiceQuerySchedule extends BaseCronJob { public class InvoiceQuerySchedule extends BaseCronJob {
@RequiredMark("发票查询接口唯一标识") @RequiredMark("发票查询接口唯一标识")
@PrintParamMark @PrintParamMark
private String requestUnique; private String requestUnique;
private final DealWithMapping dealWithMapping = new DealWithMapping(); private final DealWithMapping dealWithMapping = new DealWithMapping();
private final DzInvoiceMapper dzInvoiceMapper = Util.getMapper(DzInvoiceMapper.class); private final DzInvoiceMapper dzInvoiceMapper = Util.getMapper(DzInvoiceMapper.class);
private final HttpUtils httpUtils = new HttpUtils(); private final HttpUtils httpUtils = new HttpUtils();
private final Logger logger = Util.getLogger(); private final Logger logger = Util.getLogger();
@Override @Override
public void execute() { public void execute() {
try { try{
logger.info(String.format("================== {%s} 定时任务开始执行 ================", this.getClass().getName())); logger.info(String.format("================== {%s} 定时任务开始执行 ================",this.getClass().getName()));
logger.info(String.format("param: requestUnique ==>[%s]", requestUnique)); logger.info(String.format("param: requestUnique ==>[%s]",requestUnique));
Util.verifyRequiredField(this); Util.verifyRequiredField(this);
List<Map<String, Object>> invoiceList = dzInvoiceMapper.queryOnChooseInvoices(); List<Map<String, Object>> invoiceList = dzInvoiceMapper.queryOnChooseInvoices();
RequestMappingConfig requestMappingConfig = dealWithMapping.treeDealWithUniqueCode(requestUnique); RequestMappingConfig requestMappingConfig = dealWithMapping.treeDealWithUniqueCode(requestUnique);
Map<String, String> header = new HashMap<>(8); Map<String,String> header = new HashMap<>(8);
header.put("Content-Type", "application/json"); header.put("Content-Type","application/json");
if (!invoiceList.isEmpty()) { if(!invoiceList.isEmpty()){
for (Map<String, Object> invoice : invoiceList) { for (Map<String, Object> invoice : invoiceList) {
logger.info("invoice query ==>" + JSON.toJSONString(invoice)); logger.info("invoice query ==>"+ JSON.toJSONString(invoice));
Map<String, Object> requestParam = dealWithMapping.getRequestParam(invoice, requestMappingConfig); Map<String, Object> requestParam = dealWithMapping.getRequestParam(invoice,requestMappingConfig);
ResponeVo responeVo = httpUtils.apiPost(requestMappingConfig.getRequestUrl(), requestParam, header); ResponeVo responeVo = httpUtils.apiPost(requestMappingConfig.getRequestUrl(), requestParam,header);
if (responeVo.getCode() == 200) { if(responeVo.getCode() == 200){
Map<String, Object> result = responeVo.getResponseEntity(Map.class); Map<String,Object> result = responeVo.getResponseEntity(Map.class);
String code = Util.null2String(result.get("code")); String code = Util.null2String(result.get("code"));
if ("E0000".equals(code)) { if("E0000".equals(code)){
Map<String, Object> res = (Map<String, Object>) result.get("result"); Map<String,Object> res = (Map<String, Object>) result.get("result");
List<Map<String, Object>> invoices = (List<Map<String, Object>>) res.get("data"); List<Map<String,Object>> invoices = (List<Map<String, Object>>) res.get("data");
if (Objects.nonNull(invoices) && !invoices.isEmpty()) { if(Objects.nonNull(invoices) && !invoices.isEmpty()){
for (Map<String, Object> map : invoices) { for (Map<String, Object> map : invoices) {
String checkStatus = Util.null2String(map.get("checkStatus")); String checkStatus = Util.null2String(map.get("checkStatus"));
dzInvoiceMapper.updateInvoiceCheckStatus(Util.getIntValue(checkStatus), "id", invoice.get("id")); dzInvoiceMapper.updateInvoiceCheckStatus(Util.getIntValue(checkStatus),"id",invoice.get("id"));
} }
} }
} }
} else { }else {
logger.error(String.format("请求状态码不为200 发票 {%s} 查询失败!无法同步发票状态", invoice.get("invoiceNumber"))); logger.error(String.format("请求状态码不为200 发票 {%s} 查询失败!无法同步发票状态",invoice.get("invoiceNumber")));
} }
} }
} }
} catch (Exception e) { }catch (Exception e){
logger.error("同步发生异常 ==>" + Util.getErrString(e)); logger.error("同步发生异常 ==>"+Util.getErrString(e));
} }
} }
} }

View File

@ -1,16 +1,17 @@
package weaver.bokang.xiao.xhny_report.schedule; package weaver.bokang.xiao.xhny_report.schedule;
import aiyh.utils.Util; import aiyh.utils.Util;
import aiyh.utils.action.CusBaseCronJob;
import aiyh.utils.annotation.ActionDesc; import aiyh.utils.annotation.ActionDesc;
import aiyh.utils.annotation.PrintParamMark; import aiyh.utils.annotation.PrintParamMark;
import aiyh.utils.annotation.RequiredMark; import aiyh.utils.annotation.RequiredMark;
import lombok.Data; import lombok.Data;
import org.apache.log4j.Logger;
import weaver.bokang.xiao.xhny_report.entity.SourceTrackingData; import weaver.bokang.xiao.xhny_report.entity.SourceTrackingData;
import weaver.bokang.xiao.xhny_report.entity.VendorMarkReport; import weaver.bokang.xiao.xhny_report.entity.VendorMarkReport;
import weaver.bokang.xiao.xhny_report.service.ScoreChainPattern; import weaver.bokang.xiao.xhny_report.service.ScoreChainPattern;
import weaver.bokang.xiao.xhny_report.service.chain.AbstractScoreChain; import weaver.bokang.xiao.xhny_report.service.chain.AbstractScoreChain;
import weaver.bokang.xiao.xhny_report.service.store.VendorStore; import weaver.bokang.xiao.xhny_report.service.store.VendorStore;
import weaver.interfaces.schedule.BaseCronJob;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
@ -23,32 +24,33 @@ import java.util.List;
**/ **/
@Data @Data
@ActionDesc(value = "生成报表信息", author = "bokang.xiao") @ActionDesc(value = "生成报表信息", author = "bokang.xiao")
public class GenerateReportSchedule extends CusBaseCronJob { public class GenerateReportSchedule extends BaseCronJob {
private final Logger log = Util.getLogger();
@RequiredMark("报表模块id")
@PrintParamMark @RequiredMark("报表模块id")
private String reportModelId; @PrintParamMark
private String reportModelId;
@Override
public void runCode() { @Override
try { public void execute() {
// 必填参数校验 try {
Util.verifyRequiredField(this); //必填参数校验
// 公共参数初始化 Util.verifyRequiredField(this);
VendorStore instance = VendorStore.getInstance(); //公共参数初始化
instance.init(); VendorStore instance = VendorStore.getInstance();
// 获取评分处理链 instance.init();
AbstractScoreChain scoreChain = ScoreChainPattern.getScoreChain(); //获取评分处理链
// 处理数据初始化 AbstractScoreChain scoreChain = ScoreChainPattern.getScoreChain();
List<VendorMarkReport> vendorMarkReportList = new ArrayList<>(); //处理数据初始化
SourceTrackingData sourceTrackingData = new SourceTrackingData(); List<VendorMarkReport> vendorMarkReportList = new ArrayList<>();
// 进行供应商评分 SourceTrackingData sourceTrackingData = new SourceTrackingData();
scoreChain.handle(vendorMarkReportList, sourceTrackingData); //进行供应商评分
// 批量插入供应商报表数据 scoreChain.handle(vendorMarkReportList, sourceTrackingData);
// todo 批量插入供应商报表数据 //批量插入供应商报表数据
} catch (Exception e) { //todo 批量插入供应商报表数据
log.error("定时任务执行异常 ==>" + Util.getErrString(e)); }catch (Exception e){
} log.error("定时任务执行异常 ==>"+Util.getErrString(e));
} }
}
} }

View File

@ -1 +1 @@
cus.logPath= cus.logPath=/applog/tongweb/ecology_log/

View File

@ -75,25 +75,25 @@ public class ParseSqlTest extends BaseTest {
@Test @Test
public void testSqlChoose() { public void testSqlChoose() {
String sql = "@my-bind:name='likeName':value=''%' + name + '%''{}" + String sql = "@my-bind:name='likeName':value=''%' + name + '%''{}\n" +
"select * from table @my-where{" + "select * from table @my-where{\n" +
" @my-for:collection='list':separator='and'{" + "\t@my-for:collection='list':separator='and'{\n" +
" ${index} = #{item}" + "\t\t${index} = #{item}\t\n" +
" }" + "\t}\n" +
"} or @my-choose{" + "} or @my-choose{\n" +
"@my-when:test='selectValue == 1'{" + "\t@my-when:test='selectValue == 1'{\n" +
" select_name = #{selectName1}" + "\t\tselect_name = #{selectName1}\n" +
" }" + "\t}\n" +
" @my-when:test='selectValue == 2'{" + "\t@my-when:test='selectValue == 2'{\n" +
" select_name = #{selectName2}" + "\t\tselect_name = #{selectName2}\n" +
" }" + "\t}\n" +
" @my-when:test='selectValue == 3'{" + "\t@my-when:test='selectValue == 3'{\n" +
" select_name = #{selectName3}" + "\t\tselect_name = #{selectName3}\n" +
" }" + "\t}\n" +
" @my-otherwise{" + "\t@my-otherwise{\n" +
" select_name like #{likeName}" + "\t\tselect_name like #{likeName}\n" +
" }" + "\t}\n" +
"}"; "}\n";
Map<String, Object> param = new HashMap<>(); Map<String, Object> param = new HashMap<>();
param.put("list", new HashMap<String, String>() {{ param.put("list", new HashMap<String, String>() {{

View File

@ -38,7 +38,7 @@ public class AbstractCommandPropertiesFactory {
return this.setValue(commandItemList, new MyIfProperties()); return this.setValue(commandItemList, new MyIfProperties());
} }
@MethodRuleNo(name = CommandConsTant.TRIM, desc = "trim 指令参数解析") @MethodRuleNo(name = CommandConsTant.TRIM, desc = "tirm 指令参数解析")
private AbstractCommandProperties getTrimProperties(List<String> commandItemList) { private AbstractCommandProperties getTrimProperties(List<String> commandItemList) {
return this.setValue(commandItemList, new MyTrimProperties()); return this.setValue(commandItemList, new MyTrimProperties());
} }

View File

@ -10,15 +10,18 @@ import com.cloudstore.dev.api.util.Util_DataCache;
import org.junit.Test; import org.junit.Test;
import weaver.conn.RecordSet; import weaver.conn.RecordSet;
import weaver.general.BaseBean; import weaver.general.BaseBean;
import weaver.general.GCONST;
import weaver.hrm.User; import weaver.hrm.User;
import weaver.workflow.request.todo.OfsSettingObject; import weaver.workflow.request.todo.OfsSettingObject;
import weaver.workflow.request.todo.RequestUtil; import weaver.workflow.request.todo.RequestUtil;
import weaver.workflow.webservices.WorkflowBaseInfo; import weaver.workflow.webservices.WorkflowBaseInfo;
import weaver.workflow.webservices.WorkflowRequestInfo; import weaver.workflow.webservices.WorkflowRequestInfo;
import java.io.File;
import java.io.IOException; import java.io.IOException;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* <h1></h1> * <h1></h1>
@ -32,6 +35,21 @@ public class TestTaiBao extends BaseTest {
@Test @Test
public void test() { public void test() {
String logPath = GCONST.getLogPath();
try {
Map<String, Object> map = Util.getProperties2Map("logPathConfig", "cus");
if (map != null) {
if (map.containsKey("logPath")) {
logPath = "".equals(Util.null2String(map.get("logPath"))) ? logPath : Util.null2String(map.get("logPath"));
}
}
} catch (Exception ignore) {
}
if (!logPath.endsWith(File.separator)) {
logPath = logPath + File.separator;
}
System.out.println(logPath);
FunctionListService functionListService = new FunctionListService(); FunctionListService functionListService = new FunctionListService();
System.out.println(JSON.toJSONString(functionListService.getFunctionList(new User(90)))); System.out.println(JSON.toJSONString(functionListService.getFunctionList(new User(90))));
} }