提交 74dc332b authored 作者: 许俊's avatar 许俊

修改

上级 effaff73
......@@ -5,10 +5,14 @@ import lombok.extern.slf4j.Slf4j;
import net.sf.json.JSONObject;
import org.jeecg.modules.iost.API.Util.JsonUtil;
import org.jeecg.modules.iost.API.entity.Materialinventoryerror;
import org.jeecg.modules.iost.API.entity.pojo.Productionscheduling;
import org.jeecg.modules.iost.API.mapper.ProductionSchedulingMapper;
import org.jeecg.modules.iost.API.ExternalInterface.ProductionSchedulingApi;
import org.jeecg.modules.iost.API.entity.Productionschedulingerror;
import org.jeecg.modules.iost.API.mapper.pojo.ProductionschedulingPojoMapper;
import org.jeecg.modules.iost.API.service.IProductionSchedulingService;
import org.jeecg.modules.iost.API.service.pojo.ProductionOrderPojoService;
import org.jeecg.modules.iost.API.service.pojo.ProductionschedulingService;
import org.jeecg.modules.iost.API.webapi.ProductionSchedulingWebapi;
import org.jeecg.modules.iost.API.webapi.Util.WebApiLog;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -23,7 +27,7 @@ import java.util.Map;
/**
* @Description: 排产计划
* @Author: jeecg-boot
* @Date: 2021-07-14
* @Date: 2021-07-14
* @Version: V1.0
*/
@Service
......@@ -35,10 +39,11 @@ public class ProductionSchedulingServiceImpl extends ServiceImpl<ProductionSched
ProductionSchedulingWebapi productionSchedulingWebapi;
@Autowired
WebApiLog webApiLog;
@Autowired
ProductionschedulingService productionschedulingService;
@Override
public String add(Map<String,String> map) {
public String add(Map<String, String> map) {
return null;
}
......@@ -49,28 +54,38 @@ public class ProductionSchedulingServiceImpl extends ServiceImpl<ProductionSched
/**
* 同步-(从金蝶云同步数据到国网端,并且对两方操作创建同步日志)
*
* @param
* @return
*/
@Override
@Override
public void synchronization() {
List<Object> select = productionSchedulingWebapi.selectObject(null, null);
String content = (String) select.get(0);
List<Map<String, String>> list=(List<Map<String, String>>)select.get(1);
List<Object> select = productionSchedulingWebapi.selectObject(null, null);
String content = (String) select.get(0);
List<Map<String, String>> list = (List<Map<String, String>>) select.get(1);
ArrayList<Productionschedulingerror> productionschedulingerrors = new ArrayList<>();
addKingdeeJournalProductionScheduling(content,list);
addKingdeeJournalProductionScheduling(content, list);
for (Map<String, String> stringStringMap : list) {
String rs = productionSchedulingApi.add(stringStringMap); //待修改
addProductionscheduling(rs,stringStringMap,productionschedulingerrors);
addProductionscheduling(rs, stringStringMap, productionschedulingerrors);
pojosave(stringStringMap); //保存明细实体
}
this.saveBatch(productionschedulingerrors);
}
//明细实体保存
public void pojosave(Map<String, String> stringStringMap) {
Productionscheduling s = new Productionscheduling();
s.setPurchaserhqcode("SGCC");
productionschedulingService.save(s);
}
//保存国网操作的日志记录
public void addProductionscheduling(String rs,Map<String,String> stringStringMap,ArrayList<Productionschedulingerror> productionschedulingerrors) {
public void addProductionscheduling(String rs, Map<String, String> stringStringMap, ArrayList<Productionschedulingerror> productionschedulingerrors) {
JSONObject jsonObject = JSONObject.fromObject(rs);
if (!jsonObject.get("message").equals("数据库中已存在该记录")) {
Productionschedulingerror productionschedulingerror = new Productionschedulingerror();
......@@ -84,10 +99,9 @@ public class ProductionSchedulingServiceImpl extends ServiceImpl<ProductionSched
}
//保存金蝶云操作的日志记录
public void addKingdeeJournalProductionScheduling(String content,List<Map<String, String>> list)
{
public void addKingdeeJournalProductionScheduling(String content, List<Map<String, String>> list) {
try {
webApiLog.setKingdeeJournalAnotherParm(content,"推送排产计划",list);
webApiLog.setKingdeeJournalAnotherParm(content, "推送排产计划", list);
} catch (ParseException e) {
e.printStackTrace();
}
......
......@@ -6,10 +6,12 @@ import lombok.val;
import net.sf.json.JSON;
import net.sf.json.JSONObject;
import org.jeecg.modules.iost.API.Util.JsonUtil;
import org.jeecg.modules.iost.API.entity.pojo.Salesorder;
import org.jeecg.modules.iost.API.mapper.SalesOrderMapper;
import org.jeecg.modules.iost.API.ExternalInterface.SalesOrderApi;
import org.jeecg.modules.iost.API.entity.Salesordererror;
import org.jeecg.modules.iost.API.service.ISalesOrderService;
import org.jeecg.modules.iost.API.service.pojo.SalesorderPojoService;
import org.jeecg.modules.iost.API.webapi.SalesOrderWebapi;
import org.jeecg.modules.iost.API.webapi.Util.WebApiLog;
import org.jeecg.modules.system.entity.SysPosition;
......@@ -38,6 +40,8 @@ public class SalesOrderServiceImpl extends ServiceImpl<SalesOrderMapper, Salesor
private SalesOrderWebapi salesOrderWebapi;
@Autowired
WebApiLog webApiLog;
@Autowired
SalesorderPojoService salesorderPojoService;
//添加单个数据到国网-销售订单
@Override
......@@ -86,8 +90,9 @@ public class SalesOrderServiceImpl extends ServiceImpl<SalesOrderMapper, Salesor
for (Map<String, String> stringStringMap : list) {
String rs = salesOrderApi.add(stringStringMap); //待修改
addSalesOrder(rs,stringStringMap,salesordererrors);
pojosave(stringStringMap); //保存明细实体
}
this.saveBatch(salesordererrors);
boolean b = this.saveBatch(salesordererrors);
}
//保存国网操作的日志记录
public void addSalesOrder(String rs,Map<String,String> stringStringMap,ArrayList<Salesordererror> salesordererrors) {
......@@ -113,4 +118,15 @@ public class SalesOrderServiceImpl extends ServiceImpl<SalesOrderMapper, Salesor
}
}
//明细实体保存
public void pojosave(Map<String, String> stringStringMap)
{
Salesorder p=new Salesorder();
p.setPurchaserhqcode("SGCC");
salesorderPojoService.save(p);
}
}
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论