Commit c469a33b by liuyang

Merge branch 'dev' of http://git.pseer.com:8800/platform/hg-smart into dev-ly

parents 8460c00a 0c12b70f
......@@ -13,6 +13,7 @@ import com.baosight.hggp.util.*;
import com.baosight.hggp.util.contants.ACConstants;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.exception.PlatException;
import com.baosight.iplat4j.core.service.impl.ServiceEPBase;
import com.baosight.iplat4j.ed.util.SequenceGenerator;
......@@ -147,7 +148,7 @@ public class ServiceHGKC005A extends ServiceEPBase {
newKc005.setInventRecordId(dbKc010.getSpecId());
newKc005.setDeleteFlag(CommonConstant.YesNo.NO_0);
DaoUtils.insert(HGKC005.INSERT, newKc005);
// 修改库存数量
HGKCTools.updateStock(newKc005);
}
}
......
......@@ -561,7 +561,8 @@ public class HGKCTools {
public static void updateStock(HGKC005 hgKc005) {
if (hgKc005.getDiffAmount().compareTo(BigDecimal.ZERO) == 0) {
throw new PlatException("入库数量不能为空");
// throw new PlatException("入库数量不能为空");
return;
}
EiInfo inInfo = new EiInfo();
inInfo.set("companyCode", hgKc005.getCompanyCode());
......
......@@ -267,6 +267,8 @@ public class HGSCTools {
put(HGSC001A.FIELD_proj_id,projId);
put("notIds",notIds);
}});
}else{
DaoUtils.update(HGSC001A.DELETE_BY_PROJID, new HashMap<String,Object>(){{put(HGSC001A.FIELD_proj_id,projId);}});
}
}
......@@ -581,6 +583,8 @@ public class HGSCTools {
//基础工时
private final static BigDecimal baseWorkHour = new BigDecimal(8);
private final static Integer finishDateDiffDay = new Integer(-3);
public static int schedule(String planCode) {
List<HGSC005A> hgsc005AList = queryByPlanCode(planCode);
// hgsc005AList.sort(Comparator.comparing(HGSC005A::getProductType).thenComparing(HGSC005A::getProcessOrder,Comparator.reverseOrder()));
......@@ -618,12 +622,17 @@ public class HGSCTools {
return hgsc005AList.size();
}
private static String handleEndDate(String endDate ,HGSC005A planInfo){
if(StringUtils.isBlank(endDate)&&StringUtils.isNotBlank(planInfo.getFinishDate())){
endDate = DateUtil.toDateStr(DateUtils.addDays(DateUtil.toDate(planInfo.getFinishDate(),DateUtil.DATE10_PATTERN),finishDateDiffDay.intValue()),DateUtil.DATE10_PATTERN);
}
return endDate;
}
private static BigDecimal calculateWordHour(HGSC005A planInfo, List<HGSJ001> hgsj001List
, List<HGPZ005> hgpz005List, List<HGPZ005A> hgpz005AList
, String endDate, BigDecimal remainder){
if(StringUtils.isBlank(endDate)){
endDate = planInfo.getFinishDate();
}
endDate = handleEndDate(endDate,planInfo);
planInfo.setPlanEndDate(endDate);
AtomicReference<BigDecimal> workHour = new AtomicReference<>(new BigDecimal(0));
BigDecimal finalRemainder = remainder;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment