sap模块代码合并

highway
zhaoxiaolin 1 year ago
parent a0e42c4565
commit f778b42cbc

@ -1,11 +0,0 @@
#for test only!
#Fri Aug 18 13:40:14 CST 2023
jco.destination.pool_capacity=true
jco.client.lang=zh
jco.client.ashost=192.168.0.53
jco.client.saprouter=
jco.client.user=MES
jco.client.sysnr=00
jco.destination.peak_limit=20
jco.client.passwd=toHkAx_@$mlAJVaiawLWK@)+b2GdTu6V{jYXBRlK{N:X_o:-
jco.client.client=800

@ -5,6 +5,7 @@ import com.op.common.core.domain.R;
import com.op.system.api.domain.sap.SapCreateOrder;
import com.op.system.api.domain.sap.SapMaterialPreparation;
import com.op.system.api.domain.sap.SapRFW;
import com.op.system.api.domain.sap.SapWorkCenter;
import com.op.system.api.factory.RemoteSapFallbackFactory;
import com.op.system.api.model.SapProOrder;
import org.springframework.cloud.openfeign.FeignClient;
@ -44,4 +45,12 @@ public interface RemoteSapService {
/**报工**/
@PostMapping("/sap/sapRFWOrder")
public R sapRFWOrder(@RequestBody SapRFW sapRFW);
/**工作中心**/
@PostMapping("/sap/sapWorkCenterSync")
public R sapWorkCenterSync(@RequestBody SapWorkCenter sapWorkCenter);
/**供应商**/
@PostMapping("/sap/sapSupplierSync")
public R sapSupplierSync(@RequestBody SapWorkCenter sapWorkCenter);
}

@ -5,6 +5,7 @@ import com.op.system.api.RemoteSapService;
import com.op.system.api.domain.sap.SapCreateOrder;
import com.op.system.api.domain.sap.SapMaterialPreparation;
import com.op.system.api.domain.sap.SapRFW;
import com.op.system.api.domain.sap.SapWorkCenter;
import com.op.system.api.model.SapProOrder;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@ -53,6 +54,16 @@ public class RemoteSapFallbackFactory implements FallbackFactory<RemoteSapServic
public R sapRFWOrder(SapRFW sapRFW) {
return R.fail("sap报工失败" + throwable.getMessage());
}
@Override
public R sapWorkCenterSync(SapWorkCenter sapWorkCenter) {
return null;
}
@Override
public R sapSupplierSync(SapWorkCenter sapWorkCenter) {
return null;
}
};
}
}

@ -265,7 +265,7 @@ public class MesPrepareServiceImpl implements IMesPrepareService {
ltgs.setConf_activity5(work.getSac5());
ltgs.setConf_activity6(work.getSac6());
SapRFW.lt_hw lthw = sapRFW.getLt_hw();//MES生产订单报工货物移动修改
lthw.setEntry_qnt(work.getQuantityFeedback().toString());
lthw.setEntry_qnt(work.getQuantityFeedback().toString());//TODO;
lthw.setMaterial(work.getProcessCode());
R r = remoteSapService.sapRFWOrder(sapRFW);
//上传成功更改mes_report_work状态

@ -199,7 +199,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
left join mes_report_work mrw on ow.workorder_code = mrw.workorder_code
left join base_team_t tm on mrw.team_code = tm.Team_Code
left join base_product_attached bpa on bpa.product_code = mrw.product_code
where CONVERT(varchar(100),ow.product_date, 23) = CONVERT(varchar(100), #{productDate}, 23)
where CONVERT(varchar(100),ow.product_date, 23) = CONVERT(varchar(100), #{productDateStr}, 23)
and mrw.work_center = #{workCenter}
order by ow.workorder_code
</select>

@ -170,6 +170,7 @@ public class ProWhiteOrderServiceImpl implements IProWhiteOrderService {
* @return
*/
@Override
@DS("#header.poolName")
public int updateProOrder(ProOrder proOrder) {
proOrder.setUpdateTime(DateUtils.getNowDate());
return proWhiteOrderMapper.updateProOrder(proOrder);
@ -182,6 +183,7 @@ public class ProWhiteOrderServiceImpl implements IProWhiteOrderService {
* @return
*/
@Override
@DS("#header.poolName")
public int deleteProOrderByIds(String[] ids) {
return proWhiteOrderMapper.deleteProOrderByIds(ids);
}
@ -193,6 +195,7 @@ public class ProWhiteOrderServiceImpl implements IProWhiteOrderService {
* @return
*/
@Override
@DS("#header.poolName")
public int deleteProOrderById(String id) {
return proWhiteOrderMapper.deleteProOrderById(id);
}

@ -176,5 +176,11 @@
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
or parent_order in (
select order_code from pro_order where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
)
</delete>
</mapper>
</mapper>

@ -1,78 +0,0 @@
package com.op.quality.Controller;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.op.common.core.domain.R;
import com.op.common.core.utils.uuid.UUID;
import com.op.quality.domain.BaseFile;
import com.op.quality.domain.QcProCheck;
import com.op.quality.service.QcProCheckService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.Map;
/**
* @ClassName : quaController
* @Description :
* @Author :
* @Date: 2023-08-17 10:28
*/
@RestController
public class QuaController {
@Autowired
private QcProCheckService qcProCheckService;
@PostMapping("/saveQcProCheck")
public R<Boolean> saveQcProCheck(@RequestBody Map<QcProCheck,BaseFile> map) {
// System.out.println(qcProCheck);
// System.out.println(baseFile);
QcProCheck qcProCheck = map.keySet().iterator().next();
BaseFile baseFile = map.values().iterator().next();
if (!qcProCheck.getFactoryId().isEmpty()){
if (baseFile==null){
baseFile = new BaseFile();
qcProCheckService.saveQcProCheck(qcProCheck,baseFile);
}
if (qcProCheck.getIsqua()=="1"){
System.out.println("调用下一个接口");
return R.ok();
}
else{
return R.ok();
}
}
return R.fail();
}
@PostMapping("/test")
public R<Boolean> test() {
// System.out.println(qcProCheck);
// System.out.println(baseFile);
// QcProCheck qcProCheck = map.keySet().iterator().next();
// BaseFile baseFile = map.values().iterator().next();
QcProCheck qcProCheck = new QcProCheck();
BaseFile baseFile = new BaseFile();
qcProCheck.setId("1232132132121321");
qcProCheck.setFactoryId("qewqewqewq");
qcProCheck.setIsqua("1");
baseFile.setFileAddress("qwewqewqewqewqewqq");
if (!qcProCheck.getFactoryId().isEmpty()){
if (baseFile==null){
baseFile = new BaseFile();
qcProCheckService.saveQcProCheck(qcProCheck,baseFile);
}
if (qcProCheck.getIsqua()=="1"){
System.out.println("调用下一个接口");
return R.ok();
}
else{
return R.ok();
}
}
return R.fail();
}
}

@ -31,7 +31,7 @@ public class QcProCheckServiceImpl implements QcProCheckService {
@Override
public R<Boolean> saveQcProCheck(QcProCheck qcProCheck) {
DynamicDataSourceContextHolder.push("ds_1000");
DynamicDataSourceContextHolder.push("ds_"+qcProCheck.getFactoryCode());
qcProCheck.setId(UUID.randomUUID().toString().replace("-", ""));
//上传附件
@ -62,14 +62,14 @@ public class QcProCheckServiceImpl implements QcProCheckService {
@Override
// @DS("#header.poolName")
public int updateQcProCheck(String id) {
DynamicDataSourceContextHolder.push("ds_1000");
//DynamicDataSourceContextHolder.push("ds_1000");
return qcProCheckMapper.updateQcProCheckById(id);
}
@Override
// @DS("#header.poolName")
public int deleteQcProCheck(String id) {
DynamicDataSourceContextHolder.push("ds_1000");
//DynamicDataSourceContextHolder.push("ds_1000");
return qcProCheckMapper.deleteQcProCheckById(id);
}

@ -14,12 +14,12 @@ spring:
nacos:
discovery:
namespace: lanju-op
group: ywl
group: zxl
# 服务注册地址
server-addr: 140.249.53.142:8848
config:
namespace: lanju-op
group: ywl
group: zxl
#命名空间
#group: local
# 配置中心地址

Loading…
Cancel
Save