计划完工时间修改为上游生产订单计划完工时间
This commit is contained in:
parent
a2a8abe190
commit
51ee57a992
|
@ -3,8 +3,10 @@ package nccloud.web.mmpac.pickm.action;
|
|||
import nc.bs.dao.BaseDAO;
|
||||
import nc.bs.dao.DAOException;
|
||||
import nc.bs.framework.common.InvocationInfoProxy;
|
||||
import nc.bs.framework.common.NCLocator;
|
||||
import nc.itf.mmpac.pickm.IPickmQueryService;
|
||||
import nc.itf.mmpac.pmo.pac0002.IPMOMaintainService;
|
||||
import nc.itf.mmpac.pmo.pac0002.IPMOQueryService;
|
||||
import nc.itf.pu.m20.IPraybillMaintain;
|
||||
import nc.itf.uap.pf.busiflow.PfButtonClickContext;
|
||||
import nc.jdbc.framework.processor.ColumnProcessor;
|
||||
|
@ -20,6 +22,8 @@ import nc.vo.pu.m20.entity.PraybillVO;
|
|||
import nc.vo.pub.AggregatedValueObject;
|
||||
import nc.vo.pub.BusinessException;
|
||||
import nc.vo.pub.compiler.PfParameterVO;
|
||||
import nc.vo.pub.lang.Calendars;
|
||||
import nc.vo.pub.lang.UFDateTime;
|
||||
import nccloud.dto.mmpac.pickm.pub.entity.PickmQueryInfoDTO;
|
||||
import nccloud.framework.core.exception.ExceptionUtils;
|
||||
import nccloud.framework.core.json.IJson;
|
||||
|
@ -28,10 +32,7 @@ import nccloud.framework.web.action.itf.ICommonAction;
|
|||
import nccloud.framework.web.container.IRequest;
|
||||
import nccloud.framework.web.json.JsonFactory;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.*;
|
||||
|
||||
public class PickmToPmo implements ICommonAction {
|
||||
@Override
|
||||
|
@ -115,8 +116,10 @@ public class PickmToPmo implements ICommonAction {
|
|||
dao.executeUpdate(sql);
|
||||
}
|
||||
|
||||
private PMOAggVO[] convertToGeneralInVO(AggregatedValueObject[] sourceBillVOs, PfParameterVO srcParaVo)
|
||||
private PMOAggVO[] convertToGeneralInVO(AggPickmVO[] sourceBillVOs, PfParameterVO srcParaVo)
|
||||
throws BusinessException {
|
||||
IPMOQueryService query = (IPMOQueryService) NCLocator.getInstance().lookup(IPMOQueryService.class);
|
||||
|
||||
// 来源交易类型或单据类型,需要在单据类型中注册
|
||||
String srcBillOrTranstype = "55A3";
|
||||
// 目标交易类型或单据类型,需要在单据类型中注册
|
||||
|
@ -124,6 +127,7 @@ public class PickmToPmo implements ICommonAction {
|
|||
// classifyMode int型参数,调用模式,参照PfButtonClickContext中定义,代码中调用为接口方式 ClassifyByItfdef
|
||||
int classifyMode = PfButtonClickContext.ClassifyByItfdef;
|
||||
PMOAggVO[] inVOS = (PMOAggVO[]) PFPubService.runChangeData(srcBillOrTranstype, destBillOrTranstype, sourceBillVOs, srcParaVo, classifyMode);
|
||||
|
||||
if (MMValueCheck.isEmpty(inVOS)) {
|
||||
ExceptionUtils.wrapBusinessException("备料计划转换流程生产订单失败");
|
||||
}
|
||||
|
@ -135,12 +139,50 @@ public class PickmToPmo implements ICommonAction {
|
|||
+ InvocationInfoProxy.getInstance().getGroupId() + "' and pk_billtypecode = '" + "55A2-01" + "' ");
|
||||
head.setCtrantypeid(ctrantypeid);
|
||||
for (PMOItemVO itemVO: inVO.getChildrenVO()){
|
||||
// itemVO.setTplanendtime();
|
||||
for(AggPickmVO aggPickmVO:sourceBillVOs){
|
||||
if(itemVO.getVsrcid().equals(aggPickmVO.getParentVO().getCpickmid())){
|
||||
String[] ids = new String[1];
|
||||
ids[0] = aggPickmVO.getParentVO().getVfirstmoid();
|
||||
|
||||
PMOAggVO[] rvo = query.queryByPks(ids);
|
||||
if(null == rvo || rvo.length == 0){
|
||||
continue;
|
||||
}
|
||||
for (PMOItemVO ritem: rvo[0].getChildrenVO()){
|
||||
if(ritem.getVrowno().equals(aggPickmVO.getParentVO().getVfirstbillrowno())){
|
||||
itemVO.setTplanendtime(ritem.getTplanendtime());
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// head.setCwarehouseid("");
|
||||
}
|
||||
return inVOS;
|
||||
}
|
||||
private UFDateTime getnextmonth(UFDateTime date) {
|
||||
if (date == null) {
|
||||
throw new IllegalArgumentException("输入的 UFDateTime 不能为 null");
|
||||
}
|
||||
|
||||
// 1. 获取原始时间戳(UTC 毫秒数)
|
||||
long originalTime = date.getMillis();
|
||||
|
||||
// 2. 使用 UFDateTime 默认时区(与原类保持一致)创建日历对象
|
||||
// 注:UFDateTime 内部使用 basezoneCalendar() 时依赖 Calendars.getGMTDefault(),此处保持一致
|
||||
TimeZone defaultTimeZone = Calendars.getGMTDefault(); // 需确保 Calendars 类可访问
|
||||
GregorianCalendar calendar = new GregorianCalendar(defaultTimeZone);
|
||||
calendar.setTimeInMillis(originalTime);
|
||||
|
||||
// 3. 将月份加 1(日历自动处理 12月→次年1月,及月份天数不足的情况)
|
||||
calendar.add(java.util.Calendar.MONTH, 1);
|
||||
|
||||
// 4. 基于调整后的时间戳创建新的 UFDateTime 对象
|
||||
long nextMonthTime = calendar.getTimeInMillis();
|
||||
return new UFDateTime(nextMonthTime);
|
||||
}
|
||||
private String getValueByCondtion(String tablename, String fieldname, String contion) throws BusinessException {
|
||||
BaseDAO dao = new BaseDAO();
|
||||
|
||||
|
|
Loading…
Reference in New Issue