Merge remote-tracking branch 'origin/master'

master
Yangwl 1 year ago
commit cf3977a0e5

@ -108,23 +108,23 @@ public class ProOrderServiceImpl implements IProOrderService {
}
}
}
//校验各工序设备是否已选择
List<CascaderDTO> processes = proOrderMapper.getRouteProcess(splitOrderDTO.getRouteCode());
if (splitOrderDTO.getProdLineCodeArray().length == 0) {
//校验各工序设备是否已选择
List<CascaderDTO> processes= proOrderMapper.getRouteProcess(splitOrderDTO.getRouteCode());
if(splitOrderDTO.getProdLineCodeArray().length == 0){
checkout = false;
return error(500, "必须选择工单生产设备!");
} else {
}else{
String codeArray = JSONArray.toJSONString(splitOrderDTO.getProdLineCodeArray());
for (int i = 0; i < processes.size(); i++) {
if (codeArray.indexOf(processes.get(i).getValue()) < 0) {
for(int i=0;i<processes.size();i++){
if(codeArray.indexOf(processes.get(i).getValue())<0){
checkout = false;
return error(500, "所有有工序节点都必须选择生产设备!");
}
}
String[][] array = splitOrderDTO.getProdLineCodeArray();
for (int m = 0; m < array.length; m++) {
if (array[m].length < 2) {
for(int m=0;m<array.length;m++){
if(array[m].length<2){
checkout = false;
return error(500, "工序没有生产设备可选择,请维护工艺!");
}
@ -137,17 +137,17 @@ public class ProOrderServiceImpl implements IProOrderService {
if (checkout) {
/****白坯订单*****/
if (splitOrderDTO.getProduct().getProdType().equals("white")) {
if (splitOrderDTO.getProduct().getProdType().equals("white")){
boolean flag = false;
// 母订单
ProOrder proOrderTemp = new ProOrder();
BeanUtils.copyProperties(splitOrderDTO.getProduct(), proOrderTemp);
BeanUtils.copyProperties(splitOrderDTO.getProduct(),proOrderTemp);
// 母订单拆分数量
proOrderTemp.setUpdateTime(DateUtils.getNowDate());
proOrderTemp.setUpdateBy(SecurityContextHolder.getUserName());
proOrderTemp.setQuantitySplit(proOrderTemp.getQuantitySplit() + splitOrderDTO.getSplitNum());
proOrderTemp.setQuantitySplit(proOrderTemp.getQuantitySplit()+splitOrderDTO.getSplitNum());
// 拆分中
proOrderTemp.setStatus("o1");
// 如果拆分完就更改状态为已拆分
@ -158,7 +158,7 @@ public class ProOrderServiceImpl implements IProOrderService {
if (!flag) {
// 全部改为拆分中
proOrderMapper.updateOrderStatusByOrderCode(proOrderTemp.getOrderCode());
} else {
}else {
// 全部改为已拆分
proOrderMapper.updateOrderStatusCompleteByOrderCode(proOrderTemp.getOrderCode());
}
@ -167,7 +167,7 @@ public class ProOrderServiceImpl implements IProOrderService {
// 创建订单对象并将信息copy进去
ProOrder proOrder = new ProOrder();
BeanUtils.copyProperties(splitOrderDTO.getProduct().getChildren().get(0), proOrder);
BeanUtils.copyProperties(splitOrderDTO.getProduct().getChildren().get(0),proOrder);
// 子订单
proOrder.setUpdateTime(DateUtils.getNowDate());
proOrder.setUpdateBy(SecurityContextHolder.getUserName());
@ -175,8 +175,8 @@ public class ProOrderServiceImpl implements IProOrderService {
proOrder.setQuantity(proOrder.getQuantitySplit());
proOrder.setStatus("o1");
if (proOrder.getCarNum() != null) {
proOrder.setCarNum(proOrder.getCarNum() + splitOrderDTO.getCarNum());
} else {
proOrder.setCarNum(proOrder.getCarNum()+splitOrderDTO.getCarNum());
}else {
proOrder.setCarNum(splitOrderDTO.getCarNum());
}
@ -189,7 +189,7 @@ public class ProOrderServiceImpl implements IProOrderService {
ProOrderWorkorder proOrderWorkorder = setCommonWorkAttribute(
proOrder, splitOrderDTO.getProductDate(),
splitOrderDTO.getProdLineCode(), splitOrderDTO.getShiftId(),
splitOrderDTO.getRouteCode(), splitOrderDTO.getSortNo()
splitOrderDTO.getRouteCode(),splitOrderDTO.getSortNo()
);
// 设置批次表通用信息
ProOrderWorkorderBatch proOrderWorkorderBatch = setCommonBatchAttribute();
@ -197,7 +197,7 @@ public class ProOrderServiceImpl implements IProOrderService {
proOrderWorkorder.setWorkorderId(IdUtils.fastSimpleUUID());
// 设置工单code
int endCode = getEndCode(proOrder.getId());
proOrderWorkorder.setWorkorderCode(proOrder.getOrderCode() + "-" + endCode);
proOrderWorkorder.setWorkorderCode(proOrder.getOrderCode()+"-"+endCode);
proOrderWorkorder.setOrderId(proOrder.getId());
proOrderWorkorder.setOrderCode(proOrder.getOrderCode());
proOrderWorkorder.setUnit(proOrder.getUnit());
@ -210,15 +210,15 @@ public class ProOrderServiceImpl implements IProOrderService {
// 插入工单/**pro_order_workorder**/
proOrderWorkorderMapper.insertProOrderWorkorder(proOrderWorkorder);
setBatch(proOrderWorkorderBatch, splitOrderDTO.getFormFields(), proOrderWorkorder.getWorkorderId(), 1L);
setBatch(proOrderWorkorderBatch,splitOrderDTO.getFormFields(),proOrderWorkorder.getWorkorderId(),1L);
//生成湿料计划------------------------------开始
List<ProWetMaterialPlanDetail> wetDetails = new ArrayList<>();
//设备-根据工单获取实际规划设备路线
String[][] lineCodes = splitOrderDTO.getProdLineCodeArray();//proRfidProcessDetailMapper.getActuaEquips(rfidInfo);
ProWetMaterialPlanDetail wetDetail = null;
for (int c1 = 0; c1 < lineCodes.length; c1++) {
if (lineCodes[c1][1].startsWith("L")) {//L1-8湿料罐
for(int c1= 0;c1<lineCodes.length;c1++){
if(lineCodes[c1][1].startsWith("L")){//L1-8湿料罐
wetDetail = new ProWetMaterialPlanDetail();
wetDetail.setId(IdUtils.fastSimpleUUID());
wetDetail.setWorkorderId(proOrderWorkorder.getWorkorderId());
@ -233,18 +233,18 @@ public class ProOrderServiceImpl implements IProOrderService {
//获取当前所选工厂
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
String key = "#header.poolName";
wetDetail.setFactoryCode(request.getHeader(key.substring(8)).replace("ds_", ""));
wetDetail.setFactoryCode(request.getHeader(key.substring(8)).replace("ds_",""));
wetDetails.add(wetDetail);
}
}
if (!CollectionUtils.isEmpty(wetDetails)) {
if(!CollectionUtils.isEmpty(wetDetails)){
proWetMaterialPlanDetailMapper.batchAddWetDetails(wetDetails);
}
//生成湿料计划------------------------------结束
return success();
} else {/****成品订单*****/
}else {/****成品订单*****/
// 创建订单对象并将信息copy进去
ProOrder proOrder = new ProOrder();
BeanUtils.copyProperties(splitOrderDTO.getProduct(), proOrder);
@ -252,7 +252,7 @@ public class ProOrderServiceImpl implements IProOrderService {
ProOrderWorkorder proOrderWorkorder = setCommonWorkAttribute(
proOrder, splitOrderDTO.getProductDate(),
splitOrderDTO.getProdLineCode(), splitOrderDTO.getShiftId(),
splitOrderDTO.getRouteCode(), splitOrderDTO.getSortNo()
splitOrderDTO.getRouteCode(),splitOrderDTO.getSortNo()
);
// 创建批次表通用对象
ProOrderWorkorderBatch workBatch = setCommonBatchAttribute();
@ -279,7 +279,7 @@ public class ProOrderServiceImpl implements IProOrderService {
workOrder.setParentOrder(parentOrder.toString());
workOrder.setSortNo(splitOrderDTO.getSortNo());
if ("0".equals(workOrder.getParentOrder())) {
if("0".equals(workOrder.getParentOrder())){
//20231127,加入belongWorkOrder概念
belongWorkOrder = workOrder.getWorkorderCode();
@ -289,14 +289,14 @@ public class ProOrderServiceImpl implements IProOrderService {
BigDecimal newSapQuantityNum = new BigDecimal(proOrder.getQuantity())
.subtract(new BigDecimal(proOrder.getQuantitySplit()));
sapChange.setQuantity(newSapQuantityNum.toString());//母订单新数量
logger.info("【成品订单拆分】母订单" + proOrder.getOrderCode() +
"订单数量变更:修改前" + proOrder.getQuantity() + "," +
",已拆数量" + proOrder.getQuantitySplit() + "," +
"给sap汇报数量" + newSapQuantityNum.toString());
logger.info("【成品订单拆分】母订单"+proOrder.getOrderCode()+
"订单数量变更:修改前"+proOrder.getQuantity()+","+
",已拆数量"+proOrder.getQuantitySplit()+","+
"给sap汇报数量"+newSapQuantityNum.toString());
R rSapChange = remoteSapService.shopUpdateSync(sapChange);//sap只能同步指定日期的数据
logger.info("母订单" + proOrder.getOrderCode() +
"订单数量变更结果:" + rSapChange.getCode() + "," + rSapChange.getMsg());
} else {
logger.info("母订单"+proOrder.getOrderCode()+
"订单数量变更结果:"+rSapChange.getCode()+","+rSapChange.getMsg());
}else{
workOrder.setProductCode(splitOrderDTO.getProduct().getChildren().get(0).getProdCode());
workOrder.setProductName(splitOrderDTO.getProduct().getChildren().get(0).getProdDesc());
}
@ -309,7 +309,7 @@ public class ProOrderServiceImpl implements IProOrderService {
setBatch(workBatch, splitOrderDTO.getFormFields(), workOrder.getWorkorderId(), conver);
// 如果存在子节点
if (proOrder.getChildren() != null && proOrder.getChildren().size() > 0) {
if (proOrder.getChildren() != null && proOrder.getChildren().size()>0) {
ProOrderDTO newProOrder = (ProOrderDTO) proOrder.getChildren().get(0);
// 更新换算值
conver = (newProOrder.getQuantity() / quantity);
@ -367,12 +367,12 @@ public class ProOrderServiceImpl implements IProOrderService {
StringBuilder prodLineName = new StringBuilder("");
StringBuilder equipCods = new StringBuilder("'");
JSONArray codeArray = JSONArray.parseArray(proOrderWorkorder.getProdLineCode());
for (int c = 0; c < codeArray.size(); c++) {
for(int c=0;c<codeArray.size();c++){
equipCods.append(codeArray.getJSONArray(c).getString(1));
equipCods.append("','");
}
Map<String, CascaderDTO> equipMap = proOrderMapper.getEquipInfoByCodes(equipCods.substring(1));//设备字典
Map<String,CascaderDTO> equipMap = proOrderMapper.getEquipInfoByCodes(equipCods.substring(1));//设备字典
for (int c = 0; c < codeArray.size(); c++) {
String equipCode = codeArray.getJSONArray(c).getString(1);
prodLineName.append(equipMap.get(equipCode).getLabel() + ",");
@ -387,7 +387,7 @@ public class ProOrderServiceImpl implements IProOrderService {
// 格式化数据
for (ProOrderWorkorderBatch batchCode : batchCodeList) {
batchCodes.add(new StringBuilder(batchCode.getBatchCode()).append(";"));
batchNums.add(new StringBuilder(batchCode.getBatchQuantity() + "").append(";"));
batchNums.add(new StringBuilder(batchCode.getBatchQuantity()+"").append(";"));
}
// 将查询结果设置到当前工单对象
proOrderWorkorder.setShiftDesc(shiftDesc);
@ -434,40 +434,32 @@ public class ProOrderServiceImpl implements IProOrderService {
// //获取当前所选工厂
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
String key = "#header.poolName";
sapqo.setWerk(request.getHeader(key.substring(8)).replace("ds_", ""));
sapqo.setWerk(request.getHeader(key.substring(8)).replace("ds_",""));
SapProOrder maxCreateTime = proOrderMapper.getMaxCreatetime();
if (maxCreateTime == null) {
if(maxCreateTime == null ){
sapqo.setErdat(DateFormatUtils.format(new Date(), "yyyyMMdd"));//S_ERDAT(创建日期) 例如20230923
} else {
}else{
sapqo.setErdat(maxCreateTime.getCreateTimeStr());//S_ERDAT(创建日期) 例如20230923
}
// //添加调用sap日志
// SysSapLog sysSapLog = new SysSapLog();
// sysSapLog.setId(IdUtils.fastSimpleUUID());
// sysSapLog.setMesssge(sapqo.toString());
// sysSapLog.setMethod("syncSAP");
// sysSapLog.setReqcode("请求");
// sysSapLog.setCreateTime(DateUtils.getNowDate());
// proOrderMapper.addSapLog(sysSapLog);
logger.info("手动订单同步:【参数】" + JSONObject.toJSONString(sapqo));
//取>=20230923的sap数据
logger.info("手动订单同步:【参数】"+ JSONObject.toJSONString(sapqo));
//取>=20230923的sap数据
R<List<SapProOrder>> rSapProOrder = remoteSapService.shopOrderSync(sapqo);//sap只能同步指定日期的数据
List<SapProOrder> newOrders = rSapProOrder.getData();
if (CollectionUtils.isEmpty(newOrders)) {
System.out.println("无" + sapqo.getErdat() + "之后的最新订单");
} else {
if(CollectionUtils.isEmpty(newOrders)){
System.out.println("无"+sapqo.getErdat()+"之后的最新订单");
}else {
syncSAPFunc(newOrders, "Job");
}
}
public String syncSAPFunc(List<SapProOrder> newOrders, String syncUser) {
public String syncSAPFunc(List<SapProOrder> newOrders,String syncUser){
String failOrder = "";
ProOrder proOrder = null;
for (SapProOrder sapProOrder : newOrders) {
if ("LJ88".equals(sapProOrder.getOrderType())) {
for (SapProOrder sapProOrder:newOrders) {
if("LJ88".equals(sapProOrder.getOrderType())){
//工单生产后整个订单就被锁定//订单存在就更新,不存在就插入
proOrder = new ProOrder();
BeanUtils.copyProperties(sapProOrder, proOrder);
@ -479,38 +471,38 @@ public class ProOrderServiceImpl implements IProOrderService {
return failOrder;
}
public String syncImportFunc(List<ProOrder> newOrders) {
public String syncImportFunc(List<ProOrder> newOrders){
String failOrder = "";
for (ProOrder proOrder : newOrders) {
for (ProOrder proOrder:newOrders) {
//prodType->@Excel(name = "产品类型", readConverterExp = "white=白坯,prod=成品")
proOrder.setCreateBy(SecurityUtils.getUsername());
proOrder.setSyncUser("import");
proOrder.setPlanFactoryCode(proOrder.getFactoryCode());
String msg = syncFunc(proOrder);
if (StringUtils.isNotBlank(msg)) {
failOrder += msg + ",";
if(StringUtils.isNotBlank(msg)){
failOrder += msg+",";
}
}
return failOrder;
}
@Transactional(rollbackFor = Exception.class)
public String syncFunc(ProOrder proOrder) {
public String syncFunc(ProOrder proOrder){
String failOrder = "";
//pro_order_workorder
Date nowDate = DateUtils.getNowDate();
ProOrder orderExit = proOrderMapper.selectProOrderByOrderCode(proOrder.getOrderCode());
if (orderExit == null) {//不存在就插入
if (orderExit==null) {//不存在就插入
proOrder.setId(IdUtils.fastSimpleUUID());
proOrder.setCreateTime(nowDate);
proOrderMapper.insertProOrder(proOrder);
logger.info("=======订单" + proOrder.getOrderCode() + "同步成功");
logger.info("=======订单"+proOrder.getOrderCode()+"同步成功");
} else {//存在,如果没活动更新,否则不允许更新,关闭订单
proOrder.setId(orderExit.getId());
proOrder.setQuantitySplit(0L);
ProOrderWorkorder owork = new ProOrderWorkorder();
owork.setOrderCode(proOrder.getOrderCode());
owork.setStatusArray("'w2','w3','w4'");//已派发w1未派w0活动w2报工w3暂停w4
owork.setStatusArray("'w1','w2','w3','w4'");//已派发w1未派w0活动w2报工w3暂停w4
List<ProOrderWorkorder> workOrders = proOrderWorkorderMapper.selectProOrderWorkorderList(owork);
if (CollectionUtils.isEmpty(workOrders)) {//更新
proOrder.setUpdateTime(nowDate);
@ -526,10 +518,10 @@ public class ProOrderServiceImpl implements IProOrderService {
//删除工单pro_order_workorder
proOrderWorkorderMapper.deleteProOrderWorkorderByOrderIds(ids);
}
logger.info("=======订单" + proOrder.getOrderCode() + "同步成功");
} else {
logger.info("=======订单"+proOrder.getOrderCode()+"同步成功");
}else{
failOrder = proOrder.getOrderCode();
logger.info("=======订单" + failOrder + "同步失败");
logger.info("=======订单"+failOrder+"同步忽略,订单已经派发");
}
}
return failOrder;
@ -568,11 +560,11 @@ public class ProOrderServiceImpl implements IProOrderService {
@Transactional
public AjaxResult importOrder(List<ProOrder> orderList) {
BaseProduct bpqo = null;
for (ProOrder order : orderList) {
if (StringUtils.isBlank(order.getOrderType())) {
for(ProOrder order:orderList){
if(StringUtils.isBlank(order.getOrderType())){
order.setOrderType("LJ01");
}
String factoryCode = ServletUtils.getRequest().getHeader("PoolName").replace("ds_", "");
String factoryCode = ServletUtils.getRequest().getHeader("PoolName").replace("ds_","");
order.setPlanFactoryCode(factoryCode);
order.setFactoryCode(factoryCode);
order.setCreateBy(SecurityUtils.getUsername());
@ -582,7 +574,7 @@ public class ProOrderServiceImpl implements IProOrderService {
bpqo = new BaseProduct();
bpqo.setProductCode(order.getProdCode());
List<BaseProduct> bp = baseProductMapper.selectBaseProductList(bpqo);
if (!CollectionUtils.isEmpty(bp)) {
if(!CollectionUtils.isEmpty(bp)){
order.setProdDesc(bp.get(0).getProductDescZh());
}
}
@ -592,8 +584,8 @@ public class ProOrderServiceImpl implements IProOrderService {
// 如果数据校验成功
if (checkResult.isSuccess()) {
String info = syncImportFunc(orderList);
return success("信息导入完成。其中导入失败订单:" + info);
} else {
return success("信息导入完成。其中导入失败订单:"+info);
}else{
return checkResult;
}
}
@ -627,7 +619,6 @@ public class ProOrderServiceImpl implements IProOrderService {
/**
* list
*
* @return
*/
@Override
@ -638,7 +629,6 @@ public class ProOrderServiceImpl implements IProOrderService {
/**
* codelist
*
* @param prodCode
* @return
*/
@ -650,41 +640,40 @@ public class ProOrderServiceImpl implements IProOrderService {
/**
* list
*
* @param routeCode
* @return
*/
@Override
@DS("#header.poolName")
public List<CascaderDTO> getProEquipment(String routeCode) {
List<CascaderDTO> level = proOrderMapper.getRouteProcess(routeCode);
List<CascaderDTO> level2 = proOrderMapper.getRouteProcessEquips(level);
Map<String, CascaderDTO> equipMap = new HashMap<>();//设备字典
if (!CollectionUtils.isEmpty(level2)) {
List<CascaderDTO> level= proOrderMapper.getRouteProcess(routeCode);
List<CascaderDTO> level2= proOrderMapper.getRouteProcessEquips(level);
Map<String,CascaderDTO> equipMap = new HashMap<>();//设备字典
if(!CollectionUtils.isEmpty(level2)){
List<String> oldCodes = level2.stream()
.filter(value -> StringUtils.isNotEmpty(value.getValue()))
.map(value -> value.getValue()).collect(Collectors.toList());
String equipCods = oldCodes.stream().reduce((sum, num) -> sum + "," + num).get();
equipMap = proOrderMapper.getEquipInfoByCodes(equipCods.replace(",", "','"));
String equipCods = oldCodes.stream().reduce((sum,num) -> sum+","+num).get();
equipMap = proOrderMapper.getEquipInfoByCodes(equipCods.replace(",","','"));
}
if (equipMap.isEmpty()) {
if(equipMap.isEmpty()){
return null;
}
List<CascaderDTO> children = null;
for (CascaderDTO level1 : level) {
for(CascaderDTO level1:level){
children = new ArrayList<>();//最终结果
List<CascaderDTO> childrens = level2.stream()
.filter(dto -> dto.getLabel().equals(level1.getValue()))
.filter(dto ->dto.getLabel().equals(level1.getValue()))
.collect(Collectors.toList());
for (CascaderDTO child : childrens) {
for(CascaderDTO child:childrens){
String[] equipstr = child.getValue().split(",");
for (String equipcode : equipstr) {
if (equipMap.get(equipcode) != null) {
for(String equipcode:equipstr){
if(equipMap.get(equipcode) != null){
children.add(equipMap.get(equipcode));
}
}
}
if (!CollectionUtils.isEmpty(children)) {
if(!CollectionUtils.isEmpty(children)){
level1.setChildren(children);
}
}
@ -694,7 +683,6 @@ public class ProOrderServiceImpl implements IProOrderService {
/**
* Code
*
* @param orderCode
* @return
*/
@ -717,7 +705,7 @@ public class ProOrderServiceImpl implements IProOrderService {
proOrderList.add(childProOrderList.get(0));
tempCode.setLength(0);
tempCode.append(childProOrderList.get(0).getOrderCode());
} else {
}else {
break;
}
}
@ -726,13 +714,13 @@ public class ProOrderServiceImpl implements IProOrderService {
ProOrder proOrderVO = new ProOrder();
// 处理列表
for (int i = proOrderList.size() - 1; i > 0; i--) {
for (int i = proOrderList.size()-1; i > 0; i--) {
List<ProOrder> setList = new ArrayList<>();
setList.add(proOrderList.get(i));
proOrderList.get(i - 1).setChildren(setList);
proOrderList.get(i-1).setChildren(setList);
}
BeanUtils.copyProperties(proOrderList.get(0), proOrderVO);
BeanUtils.copyProperties(proOrderList.get(0),proOrderVO);
return success(proOrderVO);
}
@ -750,11 +738,11 @@ public class ProOrderServiceImpl implements IProOrderService {
// sapqo.setCreateTime(calendar.getTime());
//
SapShopOrderQuery sapqo = new SapShopOrderQuery();
sapqo.setWerk(poolName.replace("ds_", ""));
sapqo.setWerk(poolName.replace("ds_",""));
SapProOrder maxCreateTime = proOrderMapper.getMaxCreatetime();
if (maxCreateTime == null) {
if(maxCreateTime == null ){
sapqo.setErdat(DateFormatUtils.format(new Date(), "yyyyMMdd"));//S_ERDAT(创建日期) 例如20230923
} else {
}else{
sapqo.setErdat(maxCreateTime.getCreateTimeStr());//S_ERDAT(创建日期) 例如20230923
}
@ -769,9 +757,9 @@ public class ProOrderServiceImpl implements IProOrderService {
R<List<SapProOrder>> rSapProOrder = remoteSapService.shopOrderSync(sapqo);
List<SapProOrder> newOrders = rSapProOrder.getData();
if (CollectionUtils.isEmpty(newOrders)) {
System.out.println("无" + sapqo.getErdat() + "之后的最新订单");
} else {
if(CollectionUtils.isEmpty(newOrders)){
System.out.println("无"+sapqo.getErdat()+"之后的最新订单");
}else {
syncSAPFunc(newOrders, "Job");
}
}
@ -943,7 +931,7 @@ public class ProOrderServiceImpl implements IProOrderService {
if (proOrder.getQuantity().longValue() == proOrder.getQuantitySplit().longValue()) {
// 已拆分
proOrder.setStatus("o2");
} else {
}else {
// 拆分中
proOrder.setStatus("o1");
}
@ -1094,11 +1082,10 @@ public class ProOrderServiceImpl implements IProOrderService {
}
return success();
}
public static void main(String args[]) {
public static void main(String args[]){
String arrayStr = "[[\"GX01\",\"LG1\"],[\"GX01\",\"LG2\"],[\"GX02\",\"S1\"],[\"GX02\",\"S2\"],[\"GX03\",\"HF01\"],[\"GX04\",\"SPJ01\"]]";
JSONArray jsonArray = JSONArray.parseArray(arrayStr);
for (int c = 0; c < jsonArray.size(); c++) {
for(int c=0;c<jsonArray.size();c++){
System.out.println(jsonArray.getJSONArray(c).getString(1));
}
}

@ -315,6 +315,7 @@ public class ProOrderWorkorderServiceImpl implements IProOrderWorkorderService {
SapCreateOrder sap = new SapCreateOrder();
sap.setWerks(whiteOrder.getFactoryCode());//工厂编码
sap.setAufpar("LJ01");//订单类型
sap.setVerid(whiteOrder.getAttr2());//生产版本
sap.setMatnr(whiteOrder.getProductCode());//物料编号
sap.setQuantity(whiteOrder.getQuantitySplit() + "");//数量
sap.setDates(DateUtils.parseDateToStr("yyyy-MM-dd", whiteOrder.getProductDate()));//开始时间

@ -6,7 +6,7 @@ import java.util.Map;
import java.util.Set;
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;
import org.slf4j.Logger;
import javax.servlet.http.HttpServletResponse;
import com.op.system.domain.SysMenu;
@ -26,7 +26,7 @@ import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
import org.slf4j.LoggerFactory;
import com.op.common.core.constant.CacheConstants;
import com.op.common.core.domain.R;
import com.op.common.core.utils.StringUtils;

@ -154,6 +154,15 @@ public class OdsProcureOutOrder extends BaseEntity {
*/
@Excel(name = "用户自定义属性2")
private String userDefined2;
private String workorderCode;
public String getWorkorderCode() {
return workorderCode;
}
public void setWorkorderCode(String workorderCode) {
this.workorderCode = workorderCode;
}
/**
* 3

@ -82,4 +82,6 @@ public interface OdsProcureOutOrderMapper {
List<String> selectOdsProcureOutOrderListZUKEN(OdsProcureOutOrder order);
List<String> selectOdsProcureOutOrderListZUKENX(OdsProcureOutOrder order);
String selectMachineCode(@Param("order")OdsProcureOutOrder odsProcureOutOrder);
}

@ -284,14 +284,15 @@ public class OdsProcureOrderServiceImpl implements IOdsProcureOrderService {
public OdsProcureOutOrder PurchaseOrderOutboundPda(OdsProcureOutOrder odsProcureOrder) {
//母单其中list里面是对应的子单
OdsProcureOutOrder odsProcureOutOrder = odsProcureOutOrderMapper.selectmesPrepare(odsProcureOrder);
String machine= odsProcureOutOrderMapper.selectMachineCode(odsProcureOutOrder);
if (odsProcureOutOrder != null) {
List<OdsProcureOutOrder> orderList = odsProcureOutOrderMapper.selectmesPrepareDetail(odsProcureOutOrder);
for (OdsProcureOutOrder order:orderList){
order.setProductionLineCode(machine);
}
odsProcureOutOrder.setList(orderList);
}
return odsProcureOutOrder;
}
@Override

@ -39,6 +39,7 @@
<result property="Active" column="Active"/>
<result property="enterpriseId" column="Enterprise_Id"/>
<result property="enterpriseCode" column="Enterprise_Code"/>
<result property="workorderCode" column="workorderCode"/>
</resultMap>
<sql id="pagination_tail">
limit #{page.pageOffset} , #{page.rows}
@ -46,232 +47,227 @@
<sql id="selectOdsProcureOutOrderVo">
select Site_code, ID, Produce_Code, Material_Code, Material_Desc, Plan_Date, Plan_Number, Unit, COALESCE(Out_Number, 0) as Out_Number , Loc_Code, Loc_Desc, Production_Line_Desc, Production_Line_Code, Order_Status, User_Defined1, User_Defined2, User_Defined3, User_Defined4, User_Defined5, User_Defined6, User_Defined7, User_Defined8, User_Defined9, User_Defined10, User_Defined11, Supplier_Code, Supplier_Name, Create_By, Create_Date, Last_Update_By, Last_Update_Date, Active, Enterprise_Id, Enterprise_Code from ods_procure_out_order
</sql>
<select id="selectOdsProcureOutOrderListZU" parameterType="OdsProcureOutOrder" resultMap="OdsProcureOutOrderResult">
SELECT
Produce_Code,
User_Defined1
FROM
ods_procure_out_order
where
Active='1'
<if test="produceCode != null and produceCode != ''">and Produce_Code like concat('%', #{produceCode}, '%')
<select id="selectOdsProcureOutOrderListZU" parameterType="OdsProcureOutOrder" resultMap="OdsProcureOutOrderResult">
SELECT
Produce_Code,
User_Defined1,
MAX(Create_Date) AS Create_Date
FROM
ods_procure_out_order
where
Active='1'
<if test="produceCode != null and produceCode != ''"> and Produce_Code like concat('%', #{produceCode}, '%')
</if>
<if test="userDefined1 != null and userDefined1 != ''">and User_Defined1 = #{userDefined1}</if>
GROUP BY Produce_Code,User_Defined1
</select>
<select id="selectOdsProcureOutOrderListZUKEN" resultType="java.lang.String">
SELECT DISTINCT
User_Defined11
FROM
ods_procure_out_order
WHERE
Active = '1'
<if test="produceCode != null and produceCode != ''">and Produce_Code = #{produceCode}</if>
<if test="userDefined1 != null and userDefined1 != ''">and User_Defined1 = #{userDefined1}</if>
AND User_Defined3 !='x'
</select>
<select id="selectOdsProcureOutOrderListZUKENX" resultType="java.lang.String">
SELECT DISTINCT
User_Defined11
FROM
ods_procure_out_order
WHERE
Active = '1'
<if test="produceCode != null and produceCode != ''">and Produce_Code = #{produceCode}</if>
<if test="userDefined1 != null and userDefined1 != ''">and User_Defined1 = #{userDefined1}</if>
AND User_Defined3 ='x'
</select>
<select id="selectOdsProcureOutOrderListZUT" parameterType="OdsProcureOutOrder"
resultMap="OdsProcureOutOrderResult">
<include refid="selectOdsProcureOutOrderVo"/>
<where>
<if test="produceCode != null and produceCode != ''">and Produce_Code like concat('%', #{produceCode},
'%')
</if>
<if test="userDefined1 != null and userDefined1 != ''">and User_Defined1 = #{userDefined1}</if>
<if test="Active != null and Active != ''">and Active = #{Active}</if>
</where>
</select>
<select id="selectOdsProcureOutOrderList" parameterType="OdsProcureOutOrder" resultMap="OdsProcureOutOrderResult">
<include refid="selectOdsProcureOutOrderVo"/>
<where>
<if test="siteCode != null and siteCode != ''">and Site_code = #{siteCode}</if>
<if test="produceCode != null and produceCode != ''">and Produce_Code = #{produceCode}</if>
<if test="materialCode != null and materialCode != ''">and Material_Code = #{materialCode}</if>
<if test="materialDesc != null and materialDesc != ''">and Material_Desc = #{materialDesc}</if>
<if test="planDate != null ">and Plan_Date = #{planDate}</if>
<if test="planNumber != null ">and Plan_Number = #{planNumber}</if>
<if test="Unit != null and Unit != ''">and Unit = #{Unit}</if>
<if test="outNumber != null ">and Out_Number = #{outNumber}</if>
<if test="locCode != null and locCode != ''">and Loc_Code = #{locCode}</if>
<if test="locDesc != null and locDesc != ''">and Loc_Desc = #{locDesc}</if>
<if test="productionLineDesc != null and productionLineDesc != ''">and Production_Line_Desc =
#{productionLineDesc}
</if>
<if test="productionLineCode != null and productionLineCode != ''">and Production_Line_Code =
#{productionLineCode}
</if>
<if test="orderStatus != null and orderStatus != ''">and Order_Status = #{orderStatus}</if>
<if test="userDefined1 != null and userDefined1 != ''">and User_Defined1 = #{userDefined1}</if>
<if test="userDefined2 != null and userDefined2 != ''">and User_Defined2 = #{userDefined2}</if>
<if test="userDefined3 != null and userDefined3 != ''">and User_Defined3 = #{userDefined3}</if>
<if test="userDefined4 != null and userDefined4 != ''">and User_Defined4 = #{userDefined4}</if>
<if test="userDefined5 != null and userDefined5 != ''">and User_Defined5 = #{userDefined5}</if>
<if test="userDefined6 != null and userDefined6 != ''">and User_Defined6 = #{userDefined6}</if>
<if test="userDefined7 != null and userDefined7 != ''">and User_Defined7 = #{userDefined7}</if>
<if test="userDefined8 != null and userDefined8 != ''">and User_Defined8 = #{userDefined8}</if>
<if test="userDefined9 != null and userDefined9 != ''">and User_Defined9 = #{userDefined9}</if>
<if test="userDefined10 != null and userDefined10 != ''">and User_Defined10 = #{userDefined10}</if>
<if test="userDefined11 != null and userDefined11 != ''">and User_Defined11 = #{userDefined11}</if>
<if test="supplierCode != null and supplierCode != ''">and Supplier_Code = #{supplierCode}</if>
<if test="supplierName != null and supplierName != ''">and Supplier_Name like concat('%', #{supplierName},
'%')
</if>
<if test="createBy != null and createBy != ''">and Create_By = #{createBy}</if>
<if test="createDate != null ">and Create_Date = #{createDate}</if>
<if test="lastUpdateBy != null and lastUpdateBy != ''">and Last_Update_By = #{lastUpdateBy}</if>
<if test="lastUpdateDate != null ">and Last_Update_Date = #{lastUpdateDate}</if>
<if test="Active != null and Active != ''">and Active = #{Active}</if>
<if test="enterpriseId != null and enterpriseId != ''">and Enterprise_Id = #{enterpriseId}</if>
<if test="enterpriseCode != null and enterpriseCode != ''">and Enterprise_Code = #{enterpriseCode}</if>
</where>
</select>
<if test="userDefined1 != null and userDefined1 != ''"> and User_Defined1 = #{userDefined1}</if>
GROUP BY Produce_Code,User_Defined1
ORDER BY
Create_Date DESC;
</select>
<select id="selectOdsProcureOutOrderListZUKEN" resultType="java.lang.String">
SELECT DISTINCT
User_Defined11
FROM
ods_procure_out_order
WHERE
Active = '1'
<if test="produceCode != null and produceCode != ''"> and Produce_Code = #{produceCode}</if>
<if test="userDefined1 != null and userDefined1 != ''"> and User_Defined1 = #{userDefined1}</if>
AND User_Defined3 !='x'
</select>
<select id="selectOdsProcureOutOrderListZUKENX" resultType="java.lang.String">
SELECT DISTINCT
User_Defined11
FROM
ods_procure_out_order
WHERE
Active = '1'
<if test="produceCode != null and produceCode != ''"> and Produce_Code = #{produceCode}</if>
<if test="userDefined1 != null and userDefined1 != ''"> and User_Defined1 = #{userDefined1}</if>
AND User_Defined3 ='x'
</select>
<select id="selectOdsProcureOutOrderListZUT" parameterType="OdsProcureOutOrder" resultMap="OdsProcureOutOrderResult">
<include refid="selectOdsProcureOutOrderVo"/>
<where>
<if test="produceCode != null and produceCode != ''"> and Produce_Code like concat('%', #{produceCode}, '%')</if>
<if test="userDefined1 != null and userDefined1 != ''"> and User_Defined1 = #{userDefined1}</if>
<if test="Active != null and Active != ''"> and Active = #{Active}</if>
</where>
</select>
<select id="selectOdsProcureOutOrderList" parameterType="OdsProcureOutOrder" resultMap="OdsProcureOutOrderResult">
<include refid="selectOdsProcureOutOrderVo"/>
<where>
<if test="siteCode != null and siteCode != ''"> and Site_code = #{siteCode}</if>
<if test="produceCode != null and produceCode != ''"> and Produce_Code = #{produceCode}</if>
<if test="materialCode != null and materialCode != ''"> and Material_Code = #{materialCode}</if>
<if test="materialDesc != null and materialDesc != ''"> and Material_Desc = #{materialDesc}</if>
<if test="planDate != null "> and Plan_Date = #{planDate}</if>
<if test="planNumber != null "> and Plan_Number = #{planNumber}</if>
<if test="Unit != null and Unit != ''"> and Unit = #{Unit}</if>
<if test="outNumber != null "> and Out_Number = #{outNumber}</if>
<if test="locCode != null and locCode != ''"> and Loc_Code = #{locCode}</if>
<if test="locDesc != null and locDesc != ''"> and Loc_Desc = #{locDesc}</if>
<if test="productionLineDesc != null and productionLineDesc != ''"> and Production_Line_Desc = #{productionLineDesc}</if>
<if test="productionLineCode != null and productionLineCode != ''"> and Production_Line_Code = #{productionLineCode}</if>
<if test="orderStatus != null and orderStatus != ''"> and Order_Status = #{orderStatus}</if>
<if test="userDefined1 != null and userDefined1 != ''"> and User_Defined1 = #{userDefined1}</if>
<if test="userDefined2 != null and userDefined2 != ''"> and User_Defined2 = #{userDefined2}</if>
<if test="userDefined3 != null and userDefined3 != ''"> and User_Defined3 = #{userDefined3}</if>
<if test="userDefined4 != null and userDefined4 != ''"> and User_Defined4 = #{userDefined4}</if>
<if test="userDefined5 != null and userDefined5 != ''"> and User_Defined5 = #{userDefined5}</if>
<if test="userDefined6 != null and userDefined6 != ''"> and User_Defined6 = #{userDefined6}</if>
<if test="userDefined7 != null and userDefined7 != ''"> and User_Defined7 = #{userDefined7}</if>
<if test="userDefined8 != null and userDefined8 != ''"> and User_Defined8 = #{userDefined8}</if>
<if test="userDefined9 != null and userDefined9 != ''"> and User_Defined9 = #{userDefined9}</if>
<if test="userDefined10 != null and userDefined10 != ''"> and User_Defined10 = #{userDefined10}</if>
<if test="userDefined11 != null and userDefined11 != ''"> and User_Defined11 = #{userDefined11}</if>
<if test="supplierCode != null and supplierCode != ''"> and Supplier_Code = #{supplierCode}</if>
<if test="supplierName != null and supplierName != ''"> and Supplier_Name like concat('%', #{supplierName}, '%')</if>
<if test="createBy != null and createBy != ''"> and Create_By = #{createBy}</if>
<if test="createDate != null "> and Create_Date = #{createDate}</if>
<if test="lastUpdateBy != null and lastUpdateBy != ''"> and Last_Update_By = #{lastUpdateBy}</if>
<if test="lastUpdateDate != null "> and Last_Update_Date = #{lastUpdateDate}</if>
<if test="Active != null and Active != ''"> and Active = #{Active}</if>
<if test="enterpriseId != null and enterpriseId != ''"> and Enterprise_Id = #{enterpriseId}</if>
<if test="enterpriseCode != null and enterpriseCode != ''"> and Enterprise_Code = #{enterpriseCode}</if>
</where>
</select>
<select id="selectOdsProcureOutOrderByID" parameterType="String" resultMap="OdsProcureOutOrderResult">
<include refid="selectOdsProcureOutOrderVo"/>
where ID = #{ID}
</select>
<select id="selectOdsProcureOutOrderByID" parameterType="String" resultMap="OdsProcureOutOrderResult">
<include refid="selectOdsProcureOutOrderVo"/>
where ID = #{ID}
</select>
<insert id="insertOdsProcureOutOrder" parameterType="OdsProcureOutOrder">
insert into ods_procure_out_order
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="siteCode != null">Site_code,</if>
<if test="ID != null">ID,</if>
<if test="produceCode != null">Produce_Code,</if>
<if test="materialCode != null">Material_Code,</if>
<if test="materialDesc != null">Material_Desc,</if>
<if test="planDate != null">Plan_Date,</if>
<if test="planNumber != null">Plan_Number,</if>
<if test="Unit != null">Unit,</if>
<if test="outNumber != null">Out_Number,</if>
<if test="locCode != null">Loc_Code,</if>
<if test="locDesc != null">Loc_Desc,</if>
<if test="productionLineDesc != null">Production_Line_Desc,</if>
<if test="productionLineCode != null">Production_Line_Code,</if>
<if test="orderStatus != null">Order_Status,</if>
<if test="userDefined1 != null">User_Defined1,</if>
<if test="userDefined2 != null">User_Defined2,</if>
<if test="userDefined3 != null">User_Defined3,</if>
<if test="userDefined4 != null">User_Defined4,</if>
<if test="userDefined5 != null">User_Defined5,</if>
<if test="userDefined6 != null">User_Defined6,</if>
<if test="userDefined7 != null">User_Defined7,</if>
<if test="userDefined8 != null">User_Defined8,</if>
<if test="userDefined9 != null">User_Defined9,</if>
<if test="userDefined10 != null">User_Defined10,</if>
<if test="userDefined11 != null">User_Defined11,</if>
<if test="supplierCode != null">Supplier_Code,</if>
<if test="supplierName != null">Supplier_Name,</if>
<if test="createBy != null">Create_By,</if>
<if test="createDate != null">Create_Date,</if>
<if test="lastUpdateBy != null">Last_Update_By,</if>
<if test="lastUpdateDate != null">Last_Update_Date,</if>
<if test="Active != null">Active,</if>
<if test="enterpriseId != null">Enterprise_Id,</if>
<if test="enterpriseCode != null">Enterprise_Code,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="siteCode != null">#{siteCode},</if>
<if test="ID != null">#{ID},</if>
<if test="produceCode != null">#{produceCode},</if>
<if test="materialCode != null">#{materialCode},</if>
<if test="materialDesc != null">#{materialDesc},</if>
<if test="planDate != null">#{planDate},</if>
<if test="planNumber != null">#{planNumber},</if>
<if test="Unit != null">#{Unit},</if>
<if test="outNumber != null">#{outNumber},</if>
<if test="locCode != null">#{locCode},</if>
<if test="locDesc != null">#{locDesc},</if>
<if test="productionLineDesc != null">#{productionLineDesc},</if>
<if test="productionLineCode != null">#{productionLineCode},</if>
<if test="orderStatus != null">#{orderStatus},</if>
<if test="userDefined1 != null">#{userDefined1},</if>
<if test="userDefined2 != null">#{userDefined2},</if>
<if test="userDefined3 != null">#{userDefined3},</if>
<if test="userDefined4 != null">#{userDefined4},</if>
<if test="userDefined5 != null">#{userDefined5},</if>
<if test="userDefined6 != null">#{userDefined6},</if>
<if test="userDefined7 != null">#{userDefined7},</if>
<if test="userDefined8 != null">#{userDefined8},</if>
<if test="userDefined9 != null">#{userDefined9},</if>
<if test="userDefined10 != null">#{userDefined10},</if>
<if test="userDefined11 != null">#{userDefined11},</if>
<if test="supplierCode != null">#{supplierCode},</if>
<if test="supplierName != null">#{supplierName},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createDate != null">#{createDate},</if>
<if test="lastUpdateBy != null">#{lastUpdateBy},</if>
<if test="lastUpdateDate != null">#{lastUpdateDate},</if>
<if test="Active != null">#{Active},</if>
<if test="enterpriseId != null">#{enterpriseId},</if>
<if test="enterpriseCode != null">#{enterpriseCode},</if>
</trim>
</insert>
<insert id="insertOdsProcureOutOrder" parameterType="OdsProcureOutOrder">
insert into ods_procure_out_order
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="siteCode != null">Site_code,</if>
<if test="ID != null">ID,</if>
<if test="produceCode != null">Produce_Code,</if>
<if test="materialCode != null">Material_Code,</if>
<if test="materialDesc != null">Material_Desc,</if>
<if test="planDate != null">Plan_Date,</if>
<if test="planNumber != null">Plan_Number,</if>
<if test="Unit != null">Unit,</if>
<if test="outNumber != null">Out_Number,</if>
<if test="locCode != null">Loc_Code,</if>
<if test="locDesc != null">Loc_Desc,</if>
<if test="productionLineDesc != null">Production_Line_Desc,</if>
<if test="productionLineCode != null">Production_Line_Code,</if>
<if test="orderStatus != null">Order_Status,</if>
<if test="userDefined1 != null">User_Defined1,</if>
<if test="userDefined2 != null">User_Defined2,</if>
<if test="userDefined3 != null">User_Defined3,</if>
<if test="userDefined4 != null">User_Defined4,</if>
<if test="userDefined5 != null">User_Defined5,</if>
<if test="userDefined6 != null">User_Defined6,</if>
<if test="userDefined7 != null">User_Defined7,</if>
<if test="userDefined8 != null">User_Defined8,</if>
<if test="userDefined9 != null">User_Defined9,</if>
<if test="userDefined10 != null">User_Defined10,</if>
<if test="userDefined11 != null">User_Defined11,</if>
<if test="supplierCode != null">Supplier_Code,</if>
<if test="supplierName != null">Supplier_Name,</if>
<if test="createBy != null">Create_By,</if>
<if test="createDate != null">Create_Date,</if>
<if test="lastUpdateBy != null">Last_Update_By,</if>
<if test="lastUpdateDate != null">Last_Update_Date,</if>
<if test="Active != null">Active,</if>
<if test="enterpriseId != null">Enterprise_Id,</if>
<if test="enterpriseCode != null">Enterprise_Code,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="siteCode != null">#{siteCode},</if>
<if test="ID != null">#{ID},</if>
<if test="produceCode != null">#{produceCode},</if>
<if test="materialCode != null">#{materialCode},</if>
<if test="materialDesc != null">#{materialDesc},</if>
<if test="planDate != null">#{planDate},</if>
<if test="planNumber != null">#{planNumber},</if>
<if test="Unit != null">#{Unit},</if>
<if test="outNumber != null">#{outNumber},</if>
<if test="locCode != null">#{locCode},</if>
<if test="locDesc != null">#{locDesc},</if>
<if test="productionLineDesc != null">#{productionLineDesc},</if>
<if test="productionLineCode != null">#{productionLineCode},</if>
<if test="orderStatus != null">#{orderStatus},</if>
<if test="userDefined1 != null">#{userDefined1},</if>
<if test="userDefined2 != null">#{userDefined2},</if>
<if test="userDefined3 != null">#{userDefined3},</if>
<if test="userDefined4 != null">#{userDefined4},</if>
<if test="userDefined5 != null">#{userDefined5},</if>
<if test="userDefined6 != null">#{userDefined6},</if>
<if test="userDefined7 != null">#{userDefined7},</if>
<if test="userDefined8 != null">#{userDefined8},</if>
<if test="userDefined9 != null">#{userDefined9},</if>
<if test="userDefined10 != null">#{userDefined10},</if>
<if test="userDefined11 != null">#{userDefined11},</if>
<if test="supplierCode != null">#{supplierCode},</if>
<if test="supplierName != null">#{supplierName},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createDate != null">#{createDate},</if>
<if test="lastUpdateBy != null">#{lastUpdateBy},</if>
<if test="lastUpdateDate != null">#{lastUpdateDate},</if>
<if test="Active != null">#{Active},</if>
<if test="enterpriseId != null">#{enterpriseId},</if>
<if test="enterpriseCode != null">#{enterpriseCode},</if>
</trim>
</insert>
<update id="updateOdsProcureOutOrder" parameterType="OdsProcureOutOrder">
update ods_procure_out_order
<trim prefix="SET" suffixOverrides=",">
<if test="siteCode != null">Site_code = #{siteCode},</if>
<if test="produceCode != null">Produce_Code = #{produceCode},</if>
<if test="materialCode != null">Material_Code = #{materialCode},</if>
<if test="materialDesc != null">Material_Desc = #{materialDesc},</if>
<if test="planDate != null">Plan_Date = #{planDate},</if>
<if test="planNumber != null">Plan_Number = #{planNumber},</if>
<if test="Unit != null">Unit = #{Unit},</if>
<if test="outNumber != null">Out_Number = #{outNumber},</if>
<if test="locCode != null">Loc_Code = #{locCode},</if>
<if test="locDesc != null">Loc_Desc = #{locDesc},</if>
<if test="productionLineDesc != null">Production_Line_Desc = #{productionLineDesc},</if>
<if test="productionLineCode != null">Production_Line_Code = #{productionLineCode},</if>
<if test="orderStatus != null">Order_Status = #{orderStatus},</if>
<if test="userDefined1 != null">User_Defined1 = #{userDefined1},</if>
<if test="userDefined2 != null">User_Defined2 = #{userDefined2},</if>
<if test="userDefined3 != null">User_Defined3 = #{userDefined3},</if>
<if test="userDefined4 != null">User_Defined4 = #{userDefined4},</if>
<if test="userDefined5 != null">User_Defined5 = #{userDefined5},</if>
<if test="userDefined6 != null">User_Defined6 = #{userDefined6},</if>
<if test="userDefined7 != null">User_Defined7 = #{userDefined7},</if>
<if test="userDefined8 != null">User_Defined8 = #{userDefined8},</if>
<if test="userDefined9 != null">User_Defined9 = #{userDefined9},</if>
<if test="userDefined10 != null">User_Defined10 = #{userDefined10},</if>
<if test="userDefined11 != null">User_Defined11 = #{userDefined11},</if>
<if test="supplierCode != null">Supplier_Code = #{supplierCode},</if>
<if test="supplierName != null">Supplier_Name = #{supplierName},</if>
<if test="createBy != null">Create_By = #{createBy},</if>
<if test="createDate != null">Create_Date = #{createDate},</if>
<if test="lastUpdateBy != null">Last_Update_By = #{lastUpdateBy},</if>
<if test="lastUpdateDate != null">Last_Update_Date = #{lastUpdateDate},</if>
<if test="Active != null">Active = #{Active},</if>
<if test="enterpriseId != null">Enterprise_Id = #{enterpriseId},</if>
<if test="enterpriseCode != null">Enterprise_Code = #{enterpriseCode},</if>
</trim>
where ID = #{ID}
</update>
<update id="updateOdsProcureOutOrder" parameterType="OdsProcureOutOrder">
update ods_procure_out_order
<trim prefix="SET" suffixOverrides=",">
<if test="siteCode != null">Site_code = #{siteCode},</if>
<if test="produceCode != null">Produce_Code = #{produceCode},</if>
<if test="materialCode != null">Material_Code = #{materialCode},</if>
<if test="materialDesc != null">Material_Desc = #{materialDesc},</if>
<if test="planDate != null">Plan_Date = #{planDate},</if>
<if test="planNumber != null">Plan_Number = #{planNumber},</if>
<if test="Unit != null">Unit = #{Unit},</if>
<if test="outNumber != null">Out_Number = #{outNumber},</if>
<if test="locCode != null">Loc_Code = #{locCode},</if>
<if test="locDesc != null">Loc_Desc = #{locDesc},</if>
<if test="productionLineDesc != null">Production_Line_Desc = #{productionLineDesc},</if>
<if test="productionLineCode != null">Production_Line_Code = #{productionLineCode},</if>
<if test="orderStatus != null">Order_Status = #{orderStatus},</if>
<if test="userDefined1 != null">User_Defined1 = #{userDefined1},</if>
<if test="userDefined2 != null">User_Defined2 = #{userDefined2},</if>
<if test="userDefined3 != null">User_Defined3 = #{userDefined3},</if>
<if test="userDefined4 != null">User_Defined4 = #{userDefined4},</if>
<if test="userDefined5 != null">User_Defined5 = #{userDefined5},</if>
<if test="userDefined6 != null">User_Defined6 = #{userDefined6},</if>
<if test="userDefined7 != null">User_Defined7 = #{userDefined7},</if>
<if test="userDefined8 != null">User_Defined8 = #{userDefined8},</if>
<if test="userDefined9 != null">User_Defined9 = #{userDefined9},</if>
<if test="userDefined10 != null">User_Defined10 = #{userDefined10},</if>
<if test="userDefined11 != null">User_Defined11 = #{userDefined11},</if>
<if test="supplierCode != null">Supplier_Code = #{supplierCode},</if>
<if test="supplierName != null">Supplier_Name = #{supplierName},</if>
<if test="createBy != null">Create_By = #{createBy},</if>
<if test="createDate != null">Create_Date = #{createDate},</if>
<if test="lastUpdateBy != null">Last_Update_By = #{lastUpdateBy},</if>
<if test="lastUpdateDate != null">Last_Update_Date = #{lastUpdateDate},</if>
<if test="Active != null">Active = #{Active},</if>
<if test="enterpriseId != null">Enterprise_Id = #{enterpriseId},</if>
<if test="enterpriseCode != null">Enterprise_Code = #{enterpriseCode},</if>
</trim>
where ID = #{ID}
</update>
<delete id="deleteOdsProcureOutOrderByID" parameterType="String">
<delete id="deleteOdsProcureOutOrderByID" parameterType="String">
delete from ods_procure_out_order where ID = #{ID}
</delete>
<delete id="deleteOdsProcureOutOrderByIDs" parameterType="String">
delete from ods_procure_out_order where ID in
<foreach item="ID" collection="array" open="(" separator="," close=")">
#{ID}
</foreach>
</delete>
<select id="selectmesPrepare" parameterType="OdsProcureOutOrder" resultMap="OdsProcureOutOrderResult">
<delete id="deleteOdsProcureOutOrderByIDs" parameterType="String">
delete from ods_procure_out_order where ID in
<foreach item="ID" collection="array" open="(" separator="," close=")">
#{ID}
</foreach>
</delete>
<select id="selectmesPrepare" parameterType="OdsProcureOutOrder" resultMap="OdsProcureOutOrderResult">
SELECT
prepare_id id,
workorder_name Produce_Code,
workorder_code workorderCode,
product_code Material_Code,
product_name Material_Desc,
unit Unit,
@ -281,7 +277,7 @@
workorder_name =#{produceCode}
</select>
<select id="selectmesPrepareDetail" parameterType="OdsProcureOutOrder" resultMap="OdsProcureOutOrderResult">
<select id="selectmesPrepareDetail" parameterType="OdsProcureOutOrder" resultMap="OdsProcureOutOrderResult">
SELECT
mes_prepare_detail.record_id ID,
mes_prepare.workorder_name,
@ -301,7 +297,7 @@
WHERE
mes_prepare_detail.prepare_id= #{ID}
</select>
<insert id="insertWmsRawMissionOut">
<insert id="insertWmsRawMissionOut" >
insert into wms_raw_mission_out(id,
prd_order,
material_code,
@ -331,78 +327,84 @@
#{createDate} )
</insert>
<update id="updateOdsProcureOutOrderByid">
<update id="updateOdsProcureOutOrderByid">
update ods_procure_out_order
set User_Defined10 = #{userDefined10},
User_Defined9 = #{userDefined9},
User_Defined11 = #{userDefined11}
where ID = #{ID}
</update>
<update id="updateOdsProcureOutOrderByids">
update ods_procure_out_order
set User_Defined10 = #{order.userDefined10},
User_Defined9 = #{order.userDefined9},
User_Defined11 = #{order.userDefined11}
where ID in
<foreach collection="list" item="item" index="index" open="(" separator="," close=")">
#{item.ID}
</foreach>
</update>
<select id="selectOdsProcureOutOrderListByIds" resultMap="OdsProcureOutOrderResult">
<include refid="selectOdsProcureOutOrderVo"/>
WHERE
<![CDATA[ Order_Status = '3' and (User_Defined10 <> '2' OR User_Defined10 is NULL ) ]]>
and ID in
<foreach collection="list" item="item" index="index" open="(" separator="," close=")">
#{item.ID}
</foreach>
</select>
<select id="selectOdsProcureOutOrderListByu1" resultMap="OdsProcureOutOrderResult">
SELECT
Site_code,
ID,
Produce_Code,
Material_Code,
Material_Desc,
Plan_Date,
Plan_Number,
Unit,
COALESCE ( Plan_Number, 0 ) AS Out_Number,
Loc_Code,
Loc_Desc,
Production_Line_Desc,
Production_Line_Code,
Order_Status,
User_Defined1,
User_Defined2,
User_Defined3,
User_Defined4,
User_Defined5,
User_Defined6,
User_Defined7,
User_Defined8,
User_Defined9,
User_Defined10,
User_Defined11,
Supplier_Code,
Supplier_Name,
Create_By,
Create_Date,
Last_Update_By,
Last_Update_Date,
Active,
Enterprise_Id,
Enterprise_Code
from ods_procure_out_order
WHERE
<![CDATA[ (User_Defined10 <> '2' OR User_Defined10 is NULL ) ]]>
and Produce_Code in
<foreach collection="list" item="item" index="index" open="(" separator="," close=")">
#{item.produceCode}
</foreach>
and User_Defined1 in
<foreach collection="list" item="item" index="index" open="(" separator="," close=")">
#{item.userDefined1}
</foreach>
</select>
<update id="updateOdsProcureOutOrderByids">
update ods_procure_out_order
set User_Defined10 = #{order.userDefined10},
User_Defined9 = #{order.userDefined9},
User_Defined11 = #{order.userDefined11}
where ID in
<foreach collection="list" item="item" index="index" open="(" separator="," close=")">
#{item.ID}
</foreach>
</update>
<select id="selectOdsProcureOutOrderListByIds" resultMap="OdsProcureOutOrderResult">
<include refid="selectOdsProcureOutOrderVo"/>
WHERE
<![CDATA[ Order_Status = '3' and (User_Defined10 <> '2' OR User_Defined10 is NULL ) ]]>
and ID in
<foreach collection="list" item="item" index="index" open="(" separator="," close=")">
#{item.ID}
</foreach>
</select>
<select id="selectOdsProcureOutOrderListByu1" resultMap="OdsProcureOutOrderResult">
SELECT
Site_code,
ID,
Produce_Code,
Material_Code,
Material_Desc,
Plan_Date,
Plan_Number,
Unit,
COALESCE ( Plan_Number, 0 ) AS Out_Number,
Loc_Code,
Loc_Desc,
Production_Line_Desc,
Production_Line_Code,
Order_Status,
User_Defined1,
User_Defined2,
User_Defined3,
User_Defined4,
User_Defined5,
User_Defined6,
User_Defined7,
User_Defined8,
User_Defined9,
User_Defined10,
User_Defined11,
Supplier_Code,
Supplier_Name,
Create_By,
Create_Date,
Last_Update_By,
Last_Update_Date,
Active,
Enterprise_Id,
Enterprise_Code
from ods_procure_out_order
WHERE
<![CDATA[ (User_Defined10 <> '2' OR User_Defined10 is NULL ) ]]>
and Produce_Code in
<foreach collection="list" item="item" index="index" open="(" separator="," close=")">
#{item.produceCode}
</foreach>
and User_Defined1 in
<foreach collection="list" item="item" index="index" open="(" separator="," close=")">
#{item.userDefined1}
</foreach>
</select>
<select id="selectMachineCode" resultType="java.lang.String">
SELECT
machine_code
FROM mes_report_work
WHERE workorder_code=#{order.workorderCode} AND end_report='1'
</select>
</mapper>

Loading…
Cancel
Save