| | |
| | | import cn.hutool.core.date.DateUtil; |
| | | import cn.hutool.core.io.IoUtil; |
| | | import cn.hutool.core.util.StrUtil; |
| | | import cn.hutool.json.JSONUtil; |
| | | import com.alibaba.excel.EasyExcel; |
| | | import com.alibaba.excel.ExcelWriter; |
| | | import com.alibaba.excel.support.ExcelTypeEnum; |
| | |
| | | import com.ruoyi.common.constant.InsOrderTypeConstants; |
| | | import com.ruoyi.common.core.domain.Result; |
| | | import com.ruoyi.common.core.domain.entity.User; |
| | | import com.ruoyi.common.enums.ContractType; |
| | | import com.ruoyi.common.enums.OrderType; |
| | | import com.ruoyi.common.numgen.NumberGenerator; |
| | | import com.ruoyi.common.utils.LimsDateUtil; |
| | |
| | | import com.ruoyi.common.utils.WxCpUtils; |
| | | import com.ruoyi.common.utils.api.IfsApiUtils; |
| | | import com.ruoyi.framework.exception.ErrorException; |
| | | import com.ruoyi.inspect.dto.CopperInsOrderDto; |
| | | import com.ruoyi.inspect.dto.OrderSplitDTO; |
| | | import com.ruoyi.inspect.dto.RawMaterialStandardTreeDto; |
| | | import com.ruoyi.inspect.dto.SampleProductDto; |
| | | import com.ruoyi.inspect.dto.*; |
| | | import com.ruoyi.inspect.excel.OrderSplitExcelData; |
| | | import com.ruoyi.inspect.excel.OrderSplitExcelListener; |
| | | import com.ruoyi.inspect.mapper.InsOrderMapper; |
| | |
| | | private IfsApiUtils ifsApiUtils; |
| | | |
| | | private IfsSplitOrderRecordService ifsSplitOrderRecordService; |
| | | |
| | | private InsUnqualifiedHandlerMapper insUnqualifiedHandlerMapper; |
| | | |
| | | private final NumberGenerator<IfsSplitOrderRecord> splitOrderRecordNumberGenerator; |
| | | |
| | |
| | | if(!validateValue){ |
| | | throw new ErrorException("报检失败,非法的销售订单分类枚举"); |
| | | } |
| | | validateUpdateBatchNo(ifsInventoryQuantity); |
| | | //批次号字母转大写 |
| | | ifsInventoryQuantity.setUpdateBatchNo(ifsInventoryQuantity.getUpdateBatchNo().toUpperCase(Locale.ROOT)); |
| | | ifsInventoryQuantityMapper.update(null, Wrappers.<IfsInventoryQuantity>lambdaUpdate() |
| | |
| | | WxCpUtils.informWebHook(wechatProperty.getExaminingUrl(), message); |
| | | }); |
| | | return 1; |
| | | } |
| | | |
| | | /** |
| | | * 校验外购订单报检的批次号是否重复 |
| | | * @param ifsInventoryQuantity |
| | | */ |
| | | public void validateUpdateBatchNo(IfsInventoryQuantity ifsInventoryQuantity){ |
| | | if(StringUtils.equals(ifsInventoryQuantity.getOrderType(),OrderType.WG.getValue())){ |
| | | //查询历史记录 |
| | | Long count = ifsInventoryQuantityMapper.selectCount(Wrappers.<IfsInventoryQuantity>lambdaQuery() |
| | | .eq(IfsInventoryQuantity::getContract,ifsInventoryQuantity.getContract()) |
| | | .eq(IfsInventoryQuantity::getPartNo,ifsInventoryQuantity.getPartNo()) |
| | | .eq(IfsInventoryQuantity::getUpdateBatchNo,ifsInventoryQuantity.getUpdateBatchNo()) |
| | | .eq(IfsInventoryQuantity::getOrderType,OrderType.WG.getValue()) |
| | | .ne(IfsInventoryQuantity::getState,0) |
| | | ); |
| | | if(count>0){ |
| | | throw new RuntimeException("报检失败,零件"+ifsInventoryQuantity.getPartNo()+"所报检的批次号【"+ifsInventoryQuantity.getUpdateBatchNo()+"】已存在!"); |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | |
| | | if(!OrderType.validateValue(ifsInventoryQuantity.getOrderType())){ |
| | | throw new ErrorException("新增报检信息失败,非法的销售订单分类枚举"); |
| | | } |
| | | validateUpdateBatchNo(ifsInventoryQuantity); |
| | | ifsInventoryQuantityMapper.insert(ifsInventoryQuantity); |
| | | } |
| | | |