提交 e68b9e2d authored 作者: 李炎's avatar 李炎

增加手动同步接口

上级 269eac37
......@@ -45,7 +45,6 @@ public class PurchaseorderApi implements API {
public String selectList(Map map) throws IOException {
hreader.put("Content-Type","application/json;charset=utf-8");//格式 传参json
hreader.put("operatetype", "QUERY");
String mapjson = JsonUtil.Mapjson(map);
String result =HttpUtil.post(url + "queryByDate", JsonUtil.Mapjson(map),hreader);
// System.out.println(result);
return result;
......
......@@ -30,7 +30,7 @@ public class PurchaseorderTimed implements Job {
public void Materialinventory() throws IOException, ParseException {
iPurchaseorderService.synchronizationList(null);
System.out.println("执行了");
// System.out.println("执行了");
}
@Override
......
......@@ -94,6 +94,7 @@ public class MaterialinventoryController {
@ApiOperation(value="国网供应商重点原材料库存API-同步", notes="国网供应商重点原材料库存API-同步")
@PostMapping(value = "/synchronization")
public Result<?> synchronization() throws ParseException {
return Result.OK(iMaterialinventoryService.synchronization(null));
Boolean synchronization = iMaterialinventoryService.synchronization(null);
return Result.OK(synchronization);
}
}
......@@ -92,6 +92,7 @@ public class PhysicalIDerrorController {
@PostMapping(value = "/synchronization")
public Result<?> synchronization() throws ParseException {
return Result.OK(physicalIDService.synchronization(null));
Boolean synchronization = physicalIDService.synchronization(null);
return Result.OK(synchronization);
}
}
......@@ -99,6 +99,7 @@ public class ProductInventoryController {
@ApiOperation(value="国网产成品库存信息API-同步今天的产成品", notes="国网产成品库存信息API-同步今天的产成品")
@PostMapping(value = "/synchronization")
public Result<?> synchronization() throws ParseException {
return Result.OK(productInventoryService.synchronization(null));
Boolean synchronization = productInventoryService.synchronization(null);
return Result.OK(synchronization);
}
}
......@@ -88,7 +88,7 @@ public class ProductionOrderController {
@ApiOperation(value="生产订单API-同步至国网", notes="生产订单API-同步至国网")
@PostMapping(value = "/synchronization")
public Result<?> synchronization() throws ParseException {
productionOrderService.synchronization(null);
return Result.OK("同步成功");
Boolean synchronization = productionOrderService.synchronization(null);
return Result.OK(synchronization);
}
}
......@@ -65,8 +65,8 @@ public class ProductionSchedulingController {
@ApiOperation(value="排产计划API-同步至国网", notes="排产计划API-同步至国网")
@PostMapping(value = "/synchronization")
public Result<?> synchronization() throws ParseException {
productionSchedulingService.synchronization(null);
return Result.OK("同步成功");
Boolean synchronization = productionSchedulingService.synchronization(null);
return Result.OK(synchronization);
}
@AutoLog(value = "国网排产计划日志-排产计划接口-分页列表查询")
......
......@@ -10,14 +10,13 @@ import org.jeecg.common.api.vo.Result;
import org.jeecg.common.aspect.annotation.AutoLog;
import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.modules.iost.API.entity.pojo.Materialinventory;
import org.jeecg.modules.iost.API.service.IMaterialinventoryService;
import org.jeecg.modules.iost.API.service.pojo.MaterialinventoryPojoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
import java.text.ParseException;
@Api(tags="存放国网重点材料数据信息")
@RestController
......@@ -26,6 +25,8 @@ import javax.servlet.http.HttpServletRequest;
public class MaterialinventoryPojoController {
@Autowired
MaterialinventoryPojoService materialinventoryPojoService;
@Autowired
IMaterialinventoryService iMaterialinventoryService;
/**
* 分页列表查询
*
......@@ -47,4 +48,11 @@ public class MaterialinventoryPojoController {
IPage<Materialinventory> pageList = materialinventoryPojoService.page(page, queryWrapper);
return Result.OK(pageList);
}
@AutoLog(value = "国网供应商重点原材料库存API-同步")
@ApiOperation(value="国网供应商重点原材料库存API-同步", notes="国网供应商重点原材料库存API-同步")
@PostMapping(value = "/synchronization")
public Result<?> synchronization() throws ParseException {
Boolean synchronization = iMaterialinventoryService.synchronization(null);
return Result.OK(synchronization);
}
}
......@@ -12,17 +12,16 @@ import org.jeecg.common.aspect.annotation.AutoLog;
import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.modules.iost.API.entity.Physicalid;
import org.jeecg.modules.iost.API.entity.Purchaseorder;
import org.jeecg.modules.iost.API.service.IPhysicalIDerrorService;
import org.jeecg.modules.iost.API.service.IPurchaseorderService;
import org.jeecg.modules.iost.API.service.PhysicalidService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
import java.text.ParseException;
@Api(tags="实物ID明细接口")
@Api(tags = "实物ID明细接口")
@RestController
@RequestMapping("/API/supplier-send-physicalid")
@Slf4j
......@@ -30,7 +29,8 @@ public class PhysicalidController {
@Autowired
PhysicalidService physicalidService;
@Autowired
IPurchaseorderService purchaseorderService;
IPhysicalIDerrorService physicalIDService;
/**
* 分页列表查询
*
......@@ -53,15 +53,11 @@ public class PhysicalidController {
return Result.OK(pageList);
}
@GetMapping(value = "test")
Result test(){
QueryWrapper<Purchaseorder> queryWrapper = new QueryWrapper<>();
queryWrapper.select("F_Id");
queryWrapper.eq("F_Id", "10052");
//查询是否为集成平台生成的订单,并过滤
Purchaseorder purchaseorders1 = purchaseorderService.getBaseMapper().selectOne(queryWrapper);
boolean b = purchaseorders1 == null;
System.out.println("purchaseorders1"+b);
return Result.OK(purchaseorders1);
}
@PostMapping(value = "/synchronization")
public Result<?> synchronization() throws ParseException {
Boolean synchronization = physicalIDService.synchronization(null);
return Result.OK(synchronization);
}
}
......@@ -11,14 +11,13 @@ import org.jeecg.common.aspect.annotation.AutoLog;
import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.modules.iost.API.entity.pojo.Materialinventory;
import org.jeecg.modules.iost.API.entity.pojo.Productinventory;
import org.jeecg.modules.iost.API.service.IProductInventoryService;
import org.jeecg.modules.iost.API.service.pojo.ProductinventoryPojoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
import java.text.ParseException;
@Api(tags="存放国网产成品数据信息")
@RestController
......@@ -28,7 +27,8 @@ public class ProductInventoryPojoController {
@Autowired
ProductinventoryPojoService productinventoryPojoService;
@Autowired
IProductInventoryService productInventoryService;
/**
* 分页列表查询
*
......@@ -50,4 +50,17 @@ public class ProductInventoryPojoController {
IPage<Productinventory> pageList = productinventoryPojoService.page(page, queryWrapper);
return Result.OK(pageList);
}
/**
* 从金蝶云即时库存中同步今天的产成品
* @return
*/
@AutoLog(value = "国网产成品库存信息API-同步今天的产成品")
@ApiOperation(value="国网产成品库存信息API-同步今天的产成品", notes="国网产成品库存信息API-同步今天的产成品")
@PostMapping(value = "/synchronization")
public Result<?> synchronization() throws ParseException {
Boolean synchronization = productInventoryService.synchronization(null);
return Result.OK(synchronization);
}
}
......@@ -10,14 +10,13 @@ import org.jeecg.common.api.vo.Result;
import org.jeecg.common.aspect.annotation.AutoLog;
import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.modules.iost.API.entity.pojo.ProductionOrder;
import org.jeecg.modules.iost.API.service.IProductionOrderService;
import org.jeecg.modules.iost.API.service.pojo.ProductionOrderPojoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
import java.text.ParseException;
@Api(tags="生产订单明细信息")
@RestController
......@@ -26,6 +25,8 @@ import javax.servlet.http.HttpServletRequest;
public class ProductionOrderPojoController {
@Autowired
ProductionOrderPojoService productionOrderPojoService;
@Autowired
IProductionOrderService productionOrderService;
/**
* 分页列表查询
*
......@@ -47,5 +48,11 @@ public class ProductionOrderPojoController {
IPage<ProductionOrder> pageList = productionOrderPojoService.page(page, queryWrapper);
return Result.OK(pageList);
}
@AutoLog(value = "生产订单API-同步至国网")
@ApiOperation(value="生产订单API-同步至国网", notes="生产订单API-同步至国网")
@PostMapping(value = "/synchronization")
public Result<?> synchronization() throws ParseException {
Boolean synchronization = productionOrderService.synchronization(null);
return Result.OK(synchronization);
}
}
......@@ -10,14 +10,13 @@ import org.jeecg.common.api.vo.Result;
import org.jeecg.common.aspect.annotation.AutoLog;
import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.modules.iost.API.entity.pojo.Productionscheduling;
import org.jeecg.modules.iost.API.service.IProductionSchedulingService;
import org.jeecg.modules.iost.API.service.pojo.ProductionschedulingPojoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
import java.text.ParseException;
@Api(tags="排产计划明细信息")
@RestController
......@@ -26,7 +25,8 @@ import javax.servlet.http.HttpServletRequest;
public class ProductionSchedulingPojoController {
@Autowired
ProductionschedulingPojoService productionschedulingPojoService;
@Autowired
IProductionSchedulingService productionSchedulingService;
@AutoLog(value = "排产计划明细信息接口-分页列表查询")
@ApiOperation(value = "排产计划明细信息接口-分页列表查询", notes = "排产计划明细信息接口-分页列表查询")
@GetMapping(value = "list")
......@@ -40,4 +40,11 @@ public class ProductionSchedulingPojoController {
IPage<Productionscheduling> pageList = productionschedulingPojoService.page(page, queryWrapper);
return Result.OK(pageList);
}
@AutoLog(value = "排产计划API-同步至国网")
@ApiOperation(value="排产计划API-同步至国网", notes="排产计划API-同步至国网")
@PostMapping(value = "/synchronization")
public Result<?> synchronization() throws ParseException {
Boolean synchronization = productionSchedulingService.synchronization(null);
return Result.OK(synchronization);
}
}
......@@ -58,12 +58,12 @@ public class PurchaseorderController {
return Result.OK(pageList);
}
@AutoLog(value = "同步生成销售订单接口-添加")
@ApiOperation(value = "同步生成销售订单接口-添加", notes = "同步生成销售订单接口-添加")
@GetMapping(value = "/synchronizationList")
@AutoLog(value = "同步生成销售订单接口-同步至金蝶")
@ApiOperation(value = "同步生成销售订单接口-同步至金蝶", notes = "同步生成销售订单接口-同步至金蝶")
@GetMapping(value = "/synchronization")
public Result<?> synchronizationList() throws IOException, ParseException {
iPurchaseorderService.synchronizationList(null);
return Result.OK();
Boolean aBoolean = iPurchaseorderService.synchronizationList(null);
return Result.OK(aBoolean);
}
......@@ -113,18 +113,6 @@ public class PurchaseorderController {
System.out.println(webreq);
return Result.OK(s);
}
/**
* 添加
*
* @param object
* @return
*/
@AutoLog(value = "采购订单接口-添加")
@ApiOperation(value="采购订单接口-添加", notes="采购订单接口-添加")
@PostMapping(value = "/synchronization")
public Result<?> synchronization(@RequestBody Object object) {
return Result.OK(iPurchaseorderService.synchronization(object));
}
/**
* 同步
......
......@@ -11,14 +11,13 @@ import org.jeecg.common.aspect.annotation.AutoLog;
import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.modules.iost.API.entity.pojo.Productinventory;
import org.jeecg.modules.iost.API.entity.pojo.Reservestock;
import org.jeecg.modules.iost.API.service.IReserveStockService;
import org.jeecg.modules.iost.API.service.pojo.ReservestockPojoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
import java.text.ParseException;
@Api(tags="存放国网备品数据信息")
@RestController
......@@ -28,6 +27,8 @@ public class ReserveStockPojoController {
@Autowired
ReservestockPojoService reservestockPojoService;
@Autowired
IReserveStockService reserveStockService;
/**
* 分页列表查询
*
......@@ -49,4 +50,16 @@ public class ReserveStockPojoController {
IPage<Reservestock> pageList = reservestockPojoService.page(page, queryWrapper);
return Result.OK(pageList);
}
/**
* 从金蝶生产入库单获取备品添加到国网
*
* @return
*/
@AutoLog(value = "国网备品库存信息API-同步")
@ApiOperation(value = "国网备品库存信息API-同步", notes = "国网备品库存信息API-同步")
@PostMapping(value = "/synchronization")
public Result<?> synchronization() throws ParseException {
return Result.OK(reserveStockService.synchronization(null));
}
}
......@@ -10,14 +10,13 @@ import org.jeecg.common.api.vo.Result;
import org.jeecg.common.aspect.annotation.AutoLog;
import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.modules.iost.API.entity.pojo.Salesorder;
import org.jeecg.modules.iost.API.service.ISalesOrderService;
import org.jeecg.modules.iost.API.service.pojo.SalesorderPojoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
import java.text.ParseException;
@Api(tags="销售订单明细信息")
@RestController
......@@ -26,7 +25,8 @@ import javax.servlet.http.HttpServletRequest;
public class SalesOrderPojoController {
@Autowired
SalesorderPojoService salesorderPojoService;
@Autowired
ISalesOrderService salesOrderService;
@AutoLog(value = "销售订单明细信息接口-分页列表查询")
@ApiOperation(value = "销售订单明细信息接口-分页列表查询", notes = "销售订单明细信息接口-分页列表查询")
@GetMapping(value = "list")
......@@ -40,4 +40,12 @@ public class SalesOrderPojoController {
IPage<Salesorder> pageList = salesorderPojoService.page(page, queryWrapper);
return Result.OK(pageList);
}
@AutoLog(value = "销售API-同步至国网")
@ApiOperation(value="销售API-同步至国网", notes="销售API-同步至国网")
@PostMapping(value = "/synchronization")
public Result<?> synchronization() throws ParseException {
Boolean synchronization = salesOrderService.synchronization(null);
return Result.OK(synchronization);
}
}
......@@ -11,14 +11,13 @@ import org.jeecg.common.aspect.annotation.AutoLog;
import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.modules.iost.API.entity.pojo.Reservestock;
import org.jeecg.modules.iost.API.entity.pojo.Supplylist;
import org.jeecg.modules.iost.API.service.ISupplyListIService;
import org.jeecg.modules.iost.API.service.pojo.SupplylistPojoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
import java.text.ParseException;
@Api(tags="存放国网供货单数据信息")
@RestController
......@@ -27,6 +26,8 @@ import javax.servlet.http.HttpServletRequest;
public class SupplyListPojoController {
@Autowired
SupplylistPojoService supplylistPojoService;
@Autowired
ISupplyListIService supplyListIService;
/**
* 分页列表查询
*
......@@ -48,4 +49,16 @@ public class SupplyListPojoController {
IPage<Supplylist> pageList = supplylistPojoService.page(page, queryWrapper);
return Result.OK(pageList);
}
/**
* 同步今天金蝶云新增的销售出货单到国网
* @return
*/
@AutoLog(value = "国网供货单信息API-同步")
@ApiOperation(value="国网供货单信息API-同步", notes="国网供货单信息API-同步")
@PostMapping(value = "/synchronization")
public Result<?> synchronization() throws ParseException {
Boolean synchronization = supplyListIService.synchronization(null);
return Result.OK(synchronization);
}
}
......@@ -52,16 +52,18 @@ public class HlsAlterController {
String indexStr = getIndexFile(originUrlpath);//解析originUrlpath 返回为文本
List urlList = analysisIndex(indexStr);//解析indexStr获取.ts文件地址
String inIp="192.168.2.209";
String localPath = "http://" + dockerip + ":" + port + path + "/";
String localPath = "http://" + ip + ":" + port + path + "/";
Map<String, InputStream> urlPathnew = new HashMap<>();
for (int i = 0; i < urlList.size(); i++) {
String url = urlList.get(i).toString();//
InputStream fileInputStream = getFileInputStream(url);
String tsUrl = UUID.randomUUID().toString() + ".ts";//文件后缀,key
String localPathTs = localPath + "asAlter/GetTs/" + tsUrl;
String resultA = indexStr.replaceAll(url, localPathTs);//文本中的“url”替换为“localPathTs”
urlPath.put(tsUrl, fileInputStream);
urlPathnew.put(tsUrl, fileInputStream);
indexStr = resultA;
}
urlPath=urlPathnew;
InputStream in = new ByteArrayInputStream(indexStr.getBytes());
OutputStream outputStream = new BufferedOutputStream(response.getOutputStream());
......
......@@ -56,7 +56,7 @@ public class HlsController {
//读取指定路径下面的文件
String indexStr = getIndexFile(originUrlpath);//解析originUrlpath 返回为文本
List urlList = analysisIndex(indexStr);//解析indexStr获取.ts文件地址
String localPath = "http://" + dockerip + ":" + port + path + "/";
String localPath = "http://" + ip + ":" + port + path + "/";
System.out.println(urlList);
for (int i = 0; i < urlList.size(); i++) {
String tsUrl = UUID.randomUUID().toString() + ".ts";//文件后缀,key
......
......@@ -27,6 +27,7 @@ import java.util.Date;
@EqualsAndHashCode(callSuper = false)
@ApiModel(value = "physicalid对象", description = "实物ID信息明细")
public class Physicalid implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
......
......@@ -20,10 +20,10 @@ import java.util.*;
@Slf4j
@EnableScheduling
public class SecurityToolsTest {
static String K3CloudURL = "http://192.168.2.243/k3cloud/";//指定地址
static String dbId = "608102e4df263c";
static String K3CloudURL = "http://1ar8696937.iok.la/k3cloud/";//指定地址
static String dbId = "60ef9f7f48f36d";
static String uid = "Administrator";
static String pwd = "888888";
static String pwd = "Kingdee$2021";
static int lang = 2052;
K3CloudApiClient client = new K3CloudApiClient(K3CloudURL);
@Test
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论