43663 试制工单不自动关单(芜湖)

tags/yfai-mes-ext-v2.3
jun 6 months ago
parent 7d0b958f40
commit 9367768764

@ -4,6 +4,7 @@ import cn.estsh.i3plus.pojo.mes.bean.MesConfig;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import java.util.List; import java.util.List;
import java.util.Objects;
/** /**
* @Description: * @Description:
@ -39,4 +40,7 @@ public interface IMesConfigService {
@ApiOperation(value = "更新配置") @ApiOperation(value = "更新配置")
void update(MesConfig mesConfig,String userName); void update(MesConfig mesConfig,String userName);
@ApiOperation(value = "数据校验")
Boolean checkCfgValue(String organizeCode, String configCode, String value);
} }

@ -6,6 +6,7 @@ import cn.estsh.i3plus.platform.common.convert.ConvertBean;
import cn.estsh.i3plus.pojo.base.bean.DdlPackBean; import cn.estsh.i3plus.pojo.base.bean.DdlPackBean;
import cn.estsh.i3plus.pojo.base.enumutil.CommonEnumUtil; import cn.estsh.i3plus.pojo.base.enumutil.CommonEnumUtil;
import cn.estsh.i3plus.pojo.base.tool.DdlPreparedPack; import cn.estsh.i3plus.pojo.base.tool.DdlPreparedPack;
import cn.estsh.i3plus.pojo.base.util.StringUtil;
import cn.estsh.i3plus.pojo.mes.bean.MesConfig; import cn.estsh.i3plus.pojo.mes.bean.MesConfig;
import cn.estsh.i3plus.pojo.mes.repository.MesConfigRepository; import cn.estsh.i3plus.pojo.mes.repository.MesConfigRepository;
import cn.estsh.impp.framework.boot.exception.ImppExceptionBuilder; import cn.estsh.impp.framework.boot.exception.ImppExceptionBuilder;
@ -17,6 +18,7 @@ import org.springframework.util.StringUtils;
import java.util.Arrays; import java.util.Arrays;
import java.util.List; import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors; import java.util.stream.Collectors;
/** /**
@ -106,4 +108,10 @@ public class MesConfigService implements IMesConfigService {
configRepository.update(mesConfig); configRepository.update(mesConfig);
} }
@Override
public Boolean checkCfgValue(String organizeCode, String configCode, String value) {
MesConfig config = getCfgValueByCode(organizeCode, configCode);
return !Objects.isNull(config) && !StringUtil.isEmpty(config.getCfgValue()) && !StringUtil.isEmpty(value) && config.getCfgValue().equals(value);
}
} }

@ -47,6 +47,7 @@ import java.text.SimpleDateFormat;
import java.util.*; import java.util.*;
import java.util.function.Function; import java.util.function.Function;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import java.util.stream.Stream;
@Service @Service
@Slf4j @Slf4j
@ -168,6 +169,9 @@ public class MesWorkOrderService extends BaseMesService<MesWorkOrder> implements
@Autowired @Autowired
private IMesProduceSnService mesProduceSnService; private IMesProduceSnService mesProduceSnService;
@Autowired
private IMesConfigService mesConfigService;
@Override @Override
public MesWorkOrder insert(MesWorkOrder bean) { public MesWorkOrder insert(MesWorkOrder bean) {
// 数据校验 // 数据校验
@ -1156,6 +1160,10 @@ public class MesWorkOrderService extends BaseMesService<MesWorkOrder> implements
DdlPackBean ddlPackBean = DdlPackBean.getDdlPackBean(organizeCode); DdlPackBean ddlPackBean = DdlPackBean.getDdlPackBean(organizeCode);
DdlPreparedPack.getNumEqualPack(MesExtEnumUtil.ORDER_TYPE.UN_SORT.getValue(), "workOrderType", ddlPackBean); DdlPreparedPack.getNumEqualPack(MesExtEnumUtil.ORDER_TYPE.UN_SORT.getValue(), "workOrderType", ddlPackBean);
DdlPreparedPack.getStringSmallerNotEqualPack(TimeTool.getToday(), "planStartTime", ddlPackBean); DdlPreparedPack.getStringSmallerNotEqualPack(TimeTool.getToday(), "planStartTime", ddlPackBean);
//非排序的试制工单(P单)不自动关单(芜湖)
if (mesConfigService.checkCfgValue(organizeCode, MesExtConstWords.CLOSE_P_WORK_ORDER, MesExtConstWords.ONE_STR)) {
DdlPreparedPack.getStringNoEqualPack(MesExtEnumUtil.ORDER_TYPE_IDENTIFICATION.P.getValue(), "orderFlag", ddlPackBean);
}
DdlPreparedPack.getNumberSmallerPack(MesExtEnumUtil.ORDER_STATUS.CLOSE.getValue(), "workOrderStatus", ddlPackBean); DdlPreparedPack.getNumberSmallerPack(MesExtEnumUtil.ORDER_STATUS.CLOSE.getValue(), "workOrderStatus", ddlPackBean);
List<MesWorkOrder> mesWorkOrderList = baseRDao.findByHqlWhere(ddlPackBean); List<MesWorkOrder> mesWorkOrderList = baseRDao.findByHqlWhere(ddlPackBean);
if(CollectionUtils.isEmpty(mesWorkOrderList)){ if(CollectionUtils.isEmpty(mesWorkOrderList)){

@ -222,6 +222,8 @@ public class MesExtConstWords {
public static final String DATE_DD_01 = "-01"; public static final String DATE_DD_01 = "-01";
//日期类型 //日期类型
public static final String DATE_DD_31 = "-31"; public static final String DATE_DD_31 = "-31";
// 1
public static final String ONE_STR = "1";
//日期类型 //日期类型
public static final String DATE_SERIAL_FORMAT = "yyyyMMdd"; public static final String DATE_SERIAL_FORMAT = "yyyyMMdd";
@ -332,6 +334,8 @@ public class MesExtConstWords {
*/ */
//通用发运报表,发运组 //通用发运报表,发运组
public static final String GENERAL_SHIPPING_PART_GROUP = "GENERAL_SHIPPING_PART_GROUP"; public static final String GENERAL_SHIPPING_PART_GROUP = "GENERAL_SHIPPING_PART_GROUP";
//非排序工单关闭是否关闭试制单
public static final String CLOSE_P_WORK_ORDER = "CLOSE_P_WORK_ORDER";
} }

Loading…
Cancel
Save