|
@ -16,6 +16,8 @@ import org.nl.common.exception.BadRequestException; |
|
|
import org.nl.common.utils.CodeUtil; |
|
|
import org.nl.common.utils.CodeUtil; |
|
|
import org.nl.common.utils.SecurityUtils; |
|
|
import org.nl.common.utils.SecurityUtils; |
|
|
import org.nl.system.service.notice.ISysNoticeService; |
|
|
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.WmsToAcsService; |
|
|
import org.nl.wms.ext.acs.service.dto.to.wms.AcsResponse; |
|
|
import org.nl.wms.ext.acs.service.dto.to.wms.AcsResponse; |
|
|
import org.nl.wms.ext.mes.service.WmsToMesService; |
|
|
import org.nl.wms.ext.mes.service.WmsToMesService; |
|
@ -60,6 +62,8 @@ public class PdmBdWorkorderServiceImpl extends ServiceImpl<PdmBdWorkorderMapper, |
|
|
@Autowired |
|
|
@Autowired |
|
|
private WmsToMesService wmsToMesService; |
|
|
private WmsToMesService wmsToMesService; |
|
|
@Autowired |
|
|
@Autowired |
|
|
|
|
|
private IMdBaseMaterialService materialService; |
|
|
|
|
|
@Autowired |
|
|
private ISchBaseVehiclematerialgroupService vehiclematerialgroupService; |
|
|
private ISchBaseVehiclematerialgroupService vehiclematerialgroupService; |
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
@ -97,6 +101,11 @@ public class PdmBdWorkorderServiceImpl extends ServiceImpl<PdmBdWorkorderMapper, |
|
|
* @param entity |
|
|
* @param entity |
|
|
*/ |
|
|
*/ |
|
|
private void toCalculatePlannedQuantity(PdmBdWorkorder 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 orderSubnum = entity.getOrder_subnum(); // 计划量
|
|
|
int guadansum = entity.getGuadansum(); // 已经包装数
|
|
|
int guadansum = entity.getGuadansum(); // 已经包装数
|
|
|
int residueNum = orderSubnum - guadansum; // 剩余数
|
|
|
int residueNum = orderSubnum - guadansum; // 剩余数
|
|
@ -220,13 +229,15 @@ public class PdmBdWorkorderServiceImpl extends ServiceImpl<PdmBdWorkorderMapper, |
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
|
public IPage<MesOrderInfo> queryMesOrder(PdmBdWorkorderQuery query, PageQuery pageQuery) { |
|
|
public IPage<MesOrderInfo> queryMesOrder(PdmBdWorkorderQuery query, PageQuery pageQuery) { |
|
|
Integer page = pageQuery.getPage() + 1; |
|
|
Integer page = pageQuery.getPage(); |
|
|
Integer size = pageQuery.getSize(); |
|
|
Integer size = pageQuery.getSize(); |
|
|
IPage<MesOrderInfo> pages = new Page<>(page, size); |
|
|
IPage<MesOrderInfo> pages = new Page<>(page, size); |
|
|
int currentPage = page * size; |
|
|
int currentPage = page * size + 1; // start
|
|
|
int currentSize = pageQuery.getPage() == 0 ? 1 : pageQuery.getPage() * size; |
|
|
int currentSize = (pageQuery.getPage() + 1) * size; // end
|
|
|
List<MesOrderInfo> mesOrderInfoList = wmsToMesService.selectPageMesOrder(query.getMaterialId(), currentPage, currentSize); |
|
|
List<MesOrderInfo> mesOrderInfoList = wmsToMesService.selectPageMesOrder(query.getMaterialId(), currentPage, currentSize); |
|
|
pages.setRecords(mesOrderInfoList); |
|
|
pages.setRecords(mesOrderInfoList); |
|
|
|
|
|
int total = wmsToMesService.getTotal(query.getMaterialId()); |
|
|
|
|
|
pages.setTotal(total); |
|
|
return pages; |
|
|
return pages; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|