|
|
@ -16,6 +16,8 @@ import org.nl.common.exception.BadRequestException; |
|
|
|
import org.nl.common.utils.CodeUtil; |
|
|
|
import org.nl.common.utils.SecurityUtils; |
|
|
|
import org.nl.system.service.notice.ISysNoticeService; |
|
|
|
import org.nl.wms.database.material.service.IMdBaseMaterialService; |
|
|
|
import org.nl.wms.database.material.service.dao.MdBaseMaterial; |
|
|
|
import org.nl.wms.ext.acs.service.WmsToAcsService; |
|
|
|
import org.nl.wms.ext.acs.service.dto.to.wms.AcsResponse; |
|
|
|
import org.nl.wms.ext.mes.service.WmsToMesService; |
|
|
@ -60,6 +62,8 @@ public class PdmBdWorkorderServiceImpl extends ServiceImpl<PdmBdWorkorderMapper, |
|
|
|
@Autowired |
|
|
|
private WmsToMesService wmsToMesService; |
|
|
|
@Autowired |
|
|
|
private IMdBaseMaterialService materialService; |
|
|
|
@Autowired |
|
|
|
private ISchBaseVehiclematerialgroupService vehiclematerialgroupService; |
|
|
|
|
|
|
|
@Override |
|
|
@ -97,6 +101,11 @@ public class PdmBdWorkorderServiceImpl extends ServiceImpl<PdmBdWorkorderMapper, |
|
|
|
* @param entity |
|
|
|
*/ |
|
|
|
private void toCalculatePlannedQuantity(PdmBdWorkorder entity) { |
|
|
|
// 获取物料
|
|
|
|
MdBaseMaterial material = materialService.getById(entity.getMaterial_id()); |
|
|
|
if (ObjectUtil.isEmpty(material.getPack_method()) || ObjectUtil.isEmpty(material.getPack_palletspec())) { |
|
|
|
throw new BadRequestException("创建工单失败,物料[" + entity.getMaterial_id() + "]包装规格为空,请维护!"); |
|
|
|
} |
|
|
|
int orderSubnum = entity.getOrder_subnum(); // 计划量
|
|
|
|
int guadansum = entity.getGuadansum(); // 已经包装数
|
|
|
|
int residueNum = orderSubnum - guadansum; // 剩余数
|
|
|
@ -220,13 +229,15 @@ public class PdmBdWorkorderServiceImpl extends ServiceImpl<PdmBdWorkorderMapper, |
|
|
|
|
|
|
|
@Override |
|
|
|
public IPage<MesOrderInfo> queryMesOrder(PdmBdWorkorderQuery query, PageQuery pageQuery) { |
|
|
|
Integer page = pageQuery.getPage() + 1; |
|
|
|
Integer page = pageQuery.getPage(); |
|
|
|
Integer size = pageQuery.getSize(); |
|
|
|
IPage<MesOrderInfo> pages = new Page<>(page, size); |
|
|
|
int currentPage = page * size; |
|
|
|
int currentSize = pageQuery.getPage() == 0 ? 1 : pageQuery.getPage() * size; |
|
|
|
int currentPage = page * size + 1; // start
|
|
|
|
int currentSize = (pageQuery.getPage() + 1) * size; // end
|
|
|
|
List<MesOrderInfo> mesOrderInfoList = wmsToMesService.selectPageMesOrder(query.getMaterialId(), currentPage, currentSize); |
|
|
|
pages.setRecords(mesOrderInfoList); |
|
|
|
int total = wmsToMesService.getTotal(query.getMaterialId()); |
|
|
|
pages.setTotal(total); |
|
|
|
return pages; |
|
|
|
} |
|
|
|
|
|
|
|