提交 597d180c authored 作者: 李炎's avatar 李炎

修改

上级 17ae6b27
......@@ -99,14 +99,14 @@ public class Swagger2Config implements WebMvcConfigurer {
private ApiInfo apiInfo() {
return new ApiInfoBuilder()
// //大标题
.title("Jeecg-Boot 后台服务API接口文档")
.title("后台服务API接口文档")
// 版本号
.version("1.0")
// .termsOfServiceUrl("NO terms of service")
// 描述
.description("后台API接口")
// 作者
.contact("JEECG团队")
// .contact("团队")
.license("The Apache License, Version 2.0")
.licenseUrl("http://www.apache.org/licenses/LICENSE-2.0.html")
.build();
......
......@@ -47,7 +47,7 @@ public class MaterialinventoryTimed implements Job {
// }
/**设置定时器功能
* */
// @Scheduled(cron = "0 0 1 * * ?")//cron表达式每天凌晨一点
@Scheduled(cron = "0 0 1 * * ?")//cron表达式每天凌晨一点
// @Scheduled(fixedDelay = 1000*60)
public void Materialinventory() throws IOException, ParseException {
iMaterialinventoryService.synchronization(null);
......
......@@ -23,7 +23,7 @@ public class PhysicalIDTimed implements Job {
IPhysicalIDerrorService physicalIDService;
/**测试定时*/
// @Scheduled(cron = "0 0 1 * * ?")//cron表达式每天凌晨一点
@Scheduled(cron = "0 0 1 * * ?")//cron表达式每天凌晨一点
// @Scheduled(fixedDelay = 1000*60)
public void Materialinventory() throws IOException, ParseException {
physicalIDService.synchronization(null);
......
......@@ -27,7 +27,7 @@ public class ProductInventoryTimed implements Job {
IProductInventoryService productInventoryService;
/**测试定时*/
// @Scheduled(cron = "0 0 1 * * ?")//cron表达式每天凌晨一点
@Scheduled(cron = "0 0 1 * * ?")//cron表达式每天凌晨一点
// @Scheduled(fixedDelay = 1000*60)
public void Materialinventory() throws IOException, ParseException {
productInventoryService.synchronization(null);
......
......@@ -19,7 +19,7 @@ import java.text.ParseException;
public class ProductionOrderTimed implements Job {
@Autowired
IProductionOrderService productionOrderService;
// @Scheduled(cron = "0 0 1 * * ?")//cron表达式每天凌晨一点
@Scheduled(cron = "0 0 1 * * ?")//cron表达式每天凌晨一点
// @Scheduled(fixedDelay = 1000*60)
public void job() throws ParseException {
productionOrderService.synchronization(null);
......
......@@ -19,7 +19,7 @@ import java.text.ParseException;
public class ProductionSchedulingTimed implements Job {
@Autowired
IProductionSchedulingService productionSchedulingService;
// @Scheduled(cron = "0 0 1 * * ?")//cron表达式每天凌晨一点
@Scheduled(cron = "0 0 1 * * ?")//cron表达式每天凌晨一点
// @Scheduled(fixedDelay = 1000*60)
public void job() throws ParseException {
productionSchedulingService.synchronization(null);
......
......@@ -25,7 +25,7 @@ public class PurchaseorderTimed implements Job {
/**
* 测试定时
*/
// @Scheduled(cron = "0 0 1 * * ?")//cron表达式每天凌晨一点
@Scheduled(cron = "0 0 1 * * ?")//cron表达式每天凌晨一点
// @Scheduled(fixedDelay = 1000 * 60)
public void Materialinventory() throws IOException, ParseException {
iPurchaseorderService.synchronizationList(null);
......
......@@ -29,7 +29,7 @@ public class ReserveStockTimed implements Job {
/**
* 测试定时
*/
// @Scheduled(cron = "0 0 1 * * ?")//cron表达式每天凌晨一点
@Scheduled(cron = "0 0 1 * * ?")//cron表达式每天凌晨一点
// @Scheduled(fixedDelay = 1000 * 60)
public void Materialinventory() throws IOException, ParseException {
reserveStockService.synchronization(null);
......
......@@ -24,7 +24,7 @@ import java.io.IOException;
public class SalesOrderTimed implements Job {
@Autowired
ISalesOrderService salesOrderService;
// @Scheduled(cron = "0 0 1 * * ?")//cron表达式每天凌晨一点
@Scheduled(cron = "0 0 1 * * ?")//cron表达式每天凌晨一点
// @Scheduled(fixedDelay = 1000*60)
public void job() throws ParseException {
salesOrderService.synchronization(null);
......
......@@ -24,7 +24,7 @@ import java.text.ParseException;
public class SupplylistTimed implements Job {
@Autowired
ISupplyListIService supplyListIService;
// @Scheduled(cron = "0 0 1 * * ?")//cron表达式每天凌晨一点
@Scheduled(cron = "0 0 1 * * ?")//cron表达式每天凌晨一点
// @Scheduled(fixedDelay = 1000*60)
public void Materialinventory() throws IOException, ParseException {
supplyListIService.synchronization(null);
......
......@@ -73,27 +73,28 @@ public class PurchaseorderServiceImpl extends ServiceImpl<PurchaseorderMapper, P
* 返回值转json
*/
Map map = null;
if (object == null) {
if (null == object) {
map = new HashMap() {{
put("modifyStartTime", getTime());
}};
} else {
map = object;
}
JSONObject jsonObject = JSONObject.fromObject(purchaseorderApi.selectList(map));
if (jsonObject.get("success") == null) {
//请求国网的返回信息
JSONObject resultValue = JSONObject.fromObject(jsonObject.get("resultValue"));
Object data = resultValue.get("data");//获取返回数据的 data对象
List<Map<String, Object>> list = com.alibaba.fastjson.JSONObject.parseObject(data.toString(), List.class);//格式转换
if (list == null && list.size() == 0) return false;
if (null == list && 0 == list.size()) return false;
//记录请求国网的返回信息
Map<Boolean, String> booleanStringMap = gridErrorService.setGridError(jsonObject, JsonUtil.Mapjson(map), BusinessNo);
String ReturnProcessId = null;
if (booleanStringMap.containsKey(true)) {
ReturnProcessId = booleanStringMap.get(true);
}
if (list != null && list.size() > 0) {
if (null != list && 0 < list.size()) {
success = this.addSalesOrderWebapi(list, ReturnProcessId);
}
} else {
......@@ -155,7 +156,7 @@ public class PurchaseorderServiceImpl extends ServiceImpl<PurchaseorderMapper, P
*/
public Boolean addSalesOrderWebapi(List<Map<String, Object>> list, String ReturnProcessId) throws ParseException {
List<Purchaseorder> purchaseordersAdd = new ArrayList<>();
Boolean fn=false;
Boolean fn = false;
for (Map<String, Object> map : list) {
if (map.get("prjname") == null ||
......@@ -184,33 +185,35 @@ public class PurchaseorderServiceImpl extends ServiceImpl<PurchaseorderMapper, P
boolean save = this.saveBatch(purchaseordersAdd);//记录明细
return save;
}
public Boolean manual(Map<String, Object> map,String ReturnProcessId) throws ParseException {
Boolean fn=false;
if (map.get("prjname") == null ||
map.get("materialcode") == null ||
map.get("amount") == null || Integer.parseInt(map.get("amount").toString()) <= 0) {
} else {
JSONObject model = JSONObject.fromObject(map);//转换数据格式
Map<String, Object> SAL_SaleOrder = FieldConversion.nameAPI(model);//拼接需要的数据 字段转换
String rswebapi = salesOrderWebapi.add(SAL_SaleOrder);//同步到金蝶
System.out.println(rswebapi);
JSONObject Result = JSONObject.fromObject(rswebapi);//
JSONObject ResponseStatus = JSONObject.fromObject(JSONObject.fromObject(Result.get("Result")).get("ResponseStatus"));
//记录金蝶日志
setKingdeeJournalReturnProcess(JsonUtil.Objectjson(SAL_SaleOrder), ReturnProcessId, rswebapi, JsonUtil.Objectjson(map));
List<Map<String, String>> SuccessEntitys = (List<Map<String, String>>) ResponseStatus.get("SuccessEntitys");//金蝶云返回值SuccessEntitys
Map<String, String> stringStringMap = SuccessEntitys.get(0);
if (stringStringMap.get("Id") != null && stringStringMap.get("Number") != null) {
fn=true;
map.put("FId", stringStringMap.get("Id"));
map.put("FNumber", stringStringMap.get("Number"));
//获取返回数据记录到记录明细
boolean save = save(JSON.parseObject(JSON.toJSONString(map), Purchaseorder.class));
}
}
return fn;
public Boolean manual(Map<String, Object> map, String ReturnProcessId) throws ParseException {
Boolean fn = false;
if (map.get("prjname") == null ||
map.get("materialcode") == null ||
map.get("amount") == null || Integer.parseInt(map.get("amount").toString()) <= 0) {
} else {
JSONObject model = JSONObject.fromObject(map);//转换数据格式
Map<String, Object> SAL_SaleOrder = FieldConversion.nameAPI(model);//拼接需要的数据 字段转换
String rswebapi = salesOrderWebapi.add(SAL_SaleOrder);//同步到金蝶
System.out.println(rswebapi);
JSONObject Result = JSONObject.fromObject(rswebapi);//
JSONObject ResponseStatus = JSONObject.fromObject(JSONObject.fromObject(Result.get("Result")).get("ResponseStatus"));
//记录金蝶日志
setKingdeeJournalReturnProcess(JsonUtil.Objectjson(SAL_SaleOrder), ReturnProcessId, rswebapi, JsonUtil.Objectjson(map));
List<Map<String, String>> SuccessEntitys = (List<Map<String, String>>) ResponseStatus.get("SuccessEntitys");//金蝶云返回值SuccessEntitys
Map<String, String> stringStringMap = SuccessEntitys.get(0);
if (stringStringMap.get("Id") != null && stringStringMap.get("Number") != null) {
fn = true;
map.put("FId", stringStringMap.get("Id"));
map.put("FNumber", stringStringMap.get("Number"));
//获取返回数据记录到记录明细
boolean save = save(JSON.parseObject(JSON.toJSONString(map), Purchaseorder.class));
}
}
return fn;
}
//金蝶日志
public Boolean setKingdeeJournalReturnProcess(String setRequest, String ReturnProcessId, String setResponse, String ReturnProcessJson) throws ParseException {
boolean ny = false;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论