Commit 01269188 by wuwenlong

生产计划bugfix

parent 9fb50a52
...@@ -32,8 +32,8 @@ public class HGSC005 extends DaoEPBase { ...@@ -32,8 +32,8 @@ public class HGSC005 extends DaoEPBase {
public static final String FIELD_plan_code = "planCode"; /* 计划编码*/ public static final String FIELD_plan_code = "planCode"; /* 计划编码*/
public static final String FIELD_commit_status = "commitStatus"; /* 提交状态 0:未提交;2:已提交*/ public static final String FIELD_commit_status = "commitStatus"; /* 提交状态 0:未提交;2:已提交*/
public static final String FIELD_finish_date = "finishDate"; /* 完工日期*/ public static final String FIELD_finish_date = "finishDate"; /* 完工日期*/
public static final String FIELD_finish_rate = "finish_rate"; /* 完工进度*/ public static final String FIELD_finish_rate = "finishRate"; /* 完工进度*/
public static final String FIELD_is_schedule = "is_schedule"; /* 是否排产 0,否 1,是*/ public static final String FIELD_is_schedule = "isSchedule"; /* 是否排产 0,否 1,是*/
public static final String FIELD_account_code = "accountCode"; /* 帐套*/ public static final String FIELD_account_code = "accountCode"; /* 帐套*/
public static final String FIELD_dep_code = "depCode"; /* 部门编码*/ public static final String FIELD_dep_code = "depCode"; /* 部门编码*/
public static final String FIELD_dep_name = "depName"; /* 部门名称*/ public static final String FIELD_dep_name = "depName"; /* 部门名称*/
...@@ -53,7 +53,7 @@ public class HGSC005 extends DaoEPBase { ...@@ -53,7 +53,7 @@ public class HGSC005 extends DaoEPBase {
public static final String COL_plan_code = "plan_code"; /* 计划编码*/ public static final String COL_plan_code = "plan_code"; /* 计划编码*/
public static final String COL_commit_status = "commit_status"; /* 提交状态 0:未提交;2:已提交*/ public static final String COL_commit_status = "commit_status"; /* 提交状态 0:未提交;2:已提交*/
public static final String COL_finish_date = "finish_date"; /* 完工日期*/ public static final String COL_finish_date = "finish_date"; /* 完工日期*/
public static final String COL_is_schedule = "is_schedule"; /* 是否排产 0,否 1,是*/ public static final String COL_is_schedule = "isSchedule"; /* 是否排产 0,否 1,是*/
// public static final String COL_finish_rate = "finish_rate"; /* 完工进度*/ // public static final String COL_finish_rate = "finish_rate"; /* 完工进度*/
public static final String COL_account_code = "account_code"; /* 帐套*/ public static final String COL_account_code = "account_code"; /* 帐套*/
public static final String COL_dep_code = "dep_code"; /* 部门编码*/ public static final String COL_dep_code = "dep_code"; /* 部门编码*/
......
package com.baosight.hggp.hg.sc.service;
import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.core.tools.EDTools;
import com.baosight.hggp.hg.ds.domain.HGDS002;
import com.baosight.hggp.hg.sc.domain.HGSC099;
import com.baosight.hggp.util.FileUtils;
import com.baosight.hggp.util.LogUtils;
import com.baosight.hggp.util.contants.ACConstants;
import com.baosight.iplat4j.core.ProjectInfo;
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.core.service.soa.XServiceManager;
import org.springframework.util.CollectionUtils;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @Author wwl
* @Date 2024/5/6 19:48
*/
public class ServiceHGSC004D extends ServiceEPBase {
/**
* 画面初始化
*
* @param inInfo
* @return
*/
public EiInfo initLoad(EiInfo inInfo) {
try {
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGSC099().eiMetadata);
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
/**
* 查询操作
*
* @param inInfo
* @return
*/
@Override
public EiInfo query(EiInfo inInfo) {
try {
// 项目环境
String projectEnv = ProjectInfo.getProjectEnv();
List<Map<String, Object>> EDCM01List = EDTools.EdCm01.list("hggp.sc.bizType");
if(!CollectionUtils.isEmpty(EDCM01List)){
List<String> bizTypes = new ArrayList<>();
for(Map<String, Object> map : EDCM01List){
bizTypes.add(map.get("itemCode").toString());
}
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, "bizTypes",bizTypes);
}
if (CommonConstant.projectEnv.RUN.equalsIgnoreCase(projectEnv)) {
inInfo = super.query(inInfo, "HGSC099.queryRun", new HGSC099());
} else {
inInfo = super.query(inInfo, "HGSC099.queryDev", new HGSC099());
}
} catch (Throwable e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
}
package com.baosight.hggp.hg.sc.service; package com.baosight.hggp.hg.sc.service;
import com.baosight.hggp.aspect.annotation.OperationLogAnnotation; import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.core.dao.DaoUtils; import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.core.security.UserSessionUtils; import com.baosight.hggp.core.security.UserSessionUtils;
import com.baosight.hggp.hg.sc.domain.HGSC005; import com.baosight.hggp.hg.sc.domain.HGSC005;
...@@ -14,6 +15,7 @@ import com.baosight.iplat4j.core.service.impl.ServiceBase; ...@@ -14,6 +15,7 @@ import com.baosight.iplat4j.core.service.impl.ServiceBase;
import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.CollectionUtils;
import java.util.*; import java.util.*;
import java.util.stream.Collectors;
/** /**
...@@ -60,7 +62,7 @@ public class ServiceHGSC005 extends ServiceBase { ...@@ -60,7 +62,7 @@ public class ServiceHGSC005 extends ServiceBase {
List<String> planCodes = ObjectUtils.listKey(resultRows, HGSC005.FIELD_plan_code); List<String> planCodes = ObjectUtils.listKey(resultRows, HGSC005.FIELD_plan_code);
List<HGSC005A> hgsc005AList = HGSCTools.THGSC005A.queryByPlanCodes(planCodes); List<HGSC005A> hgsc005AList = HGSCTools.THGSC005A.queryByPlanCodes(planCodes);
this.checkCommitDate(hgsc005AList); this.checkCommitDate(hgsc005AList);
List<Long> ids = ObjectUtils.listKey(resultRows, HGSC005.FIELD_id); List<Long> ids = MapUtils.toDaoEPBase(resultRows,HGSC005.class).stream().filter(o -> o.getCommitStatus().compareTo(CommonConstant.YesNo.NO_0)==0).map(HGSC005::getId).collect(Collectors.toList());
DaoUtils.update(HGSC005.BATCH_COMMIT, new HashMap<String,Object>(){{put("ids",ids);}}); DaoUtils.update(HGSC005.BATCH_COMMIT, new HashMap<String,Object>(){{put("ids",ids);}});
//生成生产订单 //生成生产订单
HGSCTools.THGSC006.generatorOrder(MapUtils.toDaoEPBase(inInfo,HGSC005.class), hgsc005AList); HGSCTools.THGSC006.generatorOrder(MapUtils.toDaoEPBase(inInfo,HGSC005.class), hgsc005AList);
......
...@@ -389,17 +389,17 @@ public class HGSCTools { ...@@ -389,17 +389,17 @@ public class HGSCTools {
hgpz005List.forEach(product->{ hgpz005List.forEach(product->{
if(StringUtils.equals(product.getInventCode(),planInfo.getProductCode())){ if(StringUtils.equals(product.getInventCode(),planInfo.getProductCode())){
//额定工时 //额定工时
BigDecimal timing = sj.getStandardJob().multiply(sj.getStandardDays()).divide(sj.getStandardNum()); BigDecimal timing = sj.getStandardJob().multiply(sj.getStandardDays()).divide(sj.getStandardNum(),2, ROUND_DOWN);
ComputeTypeEnum computeType = ComputeTypeEnum.getEnumByCode(sj.getComputeType()); ComputeTypeEnum computeType = ComputeTypeEnum.getEnumByCode(sj.getComputeType());
switch (computeType){ switch (computeType){
case CD: case CD:
workHour.set(product.getLength().multiply(new BigDecimal(planInfo.getQuantity())).multiply(unitConver).multiply(composingCoeff) workHour.set(product.getLength().multiply(new BigDecimal(planInfo.getQuantity())).multiply(unitConver).multiply(composingCoeff)
.divide(timing) .divide(timing,2, ROUND_DOWN)
.multiply(baseWorkHour).add(finalRemainder)); .multiply(baseWorkHour).add(finalRemainder));
break; break;
case SL: case SL:
workHour.set(new BigDecimal(planInfo.getQuantity()).multiply(composingCoeff) workHour.set(new BigDecimal(planInfo.getQuantity()).multiply(composingCoeff)
.divide(timing) .divide(timing,2, ROUND_DOWN)
.multiply(baseWorkHour).add(finalRemainder)); .multiply(baseWorkHour).add(finalRemainder));
break; break;
default: default:
...@@ -411,7 +411,7 @@ public class HGSCTools { ...@@ -411,7 +411,7 @@ public class HGSCTools {
}); });
} }
}); });
BigDecimal day = workHour.get().setScale(0, ROUND_DOWN).divide(baseWorkHour); BigDecimal day = workHour.get().divide(baseWorkHour, 0, ROUND_DOWN);
remainder = workHour.get().remainder(baseWorkHour); remainder = workHour.get().remainder(baseWorkHour);
if(day.compareTo(new BigDecimal(0))>0) { if(day.compareTo(new BigDecimal(0))>0) {
endDate = DateUtil.toDateStr(DateUtils.addDays(DateUtil.toDate(endDate,DateUtil.DATE10_PATTERN),day.intValue()),DateUtil.DATE10_PATTERN); endDate = DateUtil.toDateStr(DateUtils.addDays(DateUtil.toDate(endDate,DateUtil.DATE10_PATTERN),day.intValue()),DateUtil.DATE10_PATTERN);
......
$(function () {
IPLATUI.EFGrid = {
"result": {
columns: [{
field: "operator",
template: function (item) {
let template = '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'href="' + downloadHref(item.docId) + '" target="_blank">附件下载</a>';
return template;
}
}],
loadComplete: function(grid){
},
dataBound: function () {
}
}
};
$("#ef_form_head").hide();
// 查询
$("#QUERY").on("click", query);
});
/**
* 页面加载时执行
*/
$(window).load(function () {
// 初始化查询
query();
});
/**
* 查询
*/
var query = function (e) {
resultGrid.dataSource.page(1);
}
<!DOCTYPE html>
<%@ page contentType="text/html; charset=UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="EF" tagdir="/WEB-INF/tags/EF" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<EF:EFPage title="附件清单">
<EF:EFRegion id="inqu" title="查询区域" type="query">
<EF:EFInput cname="主表ID" ename="matId" blockId="inqu_status" row="0" type="hidden"/>
<div class="row">
<EF:EFSelect cname="文件类型" ename="inqu_status-0-bizType" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFCodeOption codeName="hggp.sc.bizType" />
</EF:EFSelect>
<EF:EFInput cname="文件名称" ename="docName" blockId="inqu_status" row="0" colWidth="3" />
</div>
</EF:EFRegion>
<EF:EFRegion id="result" title="记录集">
<EF:EFGrid blockId="result" autoDraw="override" checkMode="row" isFloat="true">
<EF:EFColumn ename="id" cname="ID" hidden="true"/>
<EF:EFColumn ename="docId" cname="文件ID" enable="false" width="150"/>
<EF:EFColumn ename="docName" cname="文件名称" enable="false" width="150"/>
<EF:EFComboColumn ename="bizType" cname="文件类型" width="80" align="center" enable="false" required="false">
<EF:EFCodeOption codeName="hggp.sc.bizType" />
</EF:EFComboColumn>
<EF:EFColumn ename="createdTime" cname="创建时间" enable="false" width="140" align="center"
parseFormats="['yyyyMMddHHmmss']" editType="datetime" dateFormat="yyyy-MM-dd HH:mm:ss"/>
<EF:EFColumn ename="operator" cname="操作" enable="false" width="200" align="center"/>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
...@@ -51,7 +51,7 @@ function showInfo(planCode) { ...@@ -51,7 +51,7 @@ function showInfo(planCode) {
*/ */
function showUploadFile(id) { function showUploadFile(id) {
JSColorbox.open({ JSColorbox.open({
href: "HGSC099?methodName=initLoad&inqu_status-0-bizType=XMRY&inqu_status-0-matId=" + id, href: "HGSC004D?methodName=initLoad&inqu_status-0-matId=" + id,
title: "<div style='text-align: center;'>附件详情</div>", title: "<div style='text-align: center;'>附件详情</div>",
width: "80%", width: "80%",
height: "80%", height: "80%",
......
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
<EF:EFColumn ename="createdTime" cname="生产计划日期" enable="true" width="120" align="center" readOnly="true"/> <EF:EFColumn ename="createdTime" cname="生产计划日期" enable="true" width="120" align="center" readOnly="true"/>
<EF:EFColumn ename="planCode" cname="生产计划单号" enable="true" width="120" align="center" readOnly="true"/> <EF:EFColumn ename="planCode" cname="生产计划单号" enable="true" width="120" align="center" readOnly="true"/>
<EF:EFColumn ename="finishDate" cname="交货日期" enable="true" width="120" align="center" readOnly="true"/> <EF:EFColumn ename="finishDate" cname="交货日期" enable="true" width="120" align="center" readOnly="true"/>
<EF:EFColumn ename="finishRate" cname="生产完工进度" format="{0:0%}" enable="true" width="120" align="center" readOnly="true"/> <EF:EFColumn ename="finishRate" cname="生产完工进度" format="{0:0}%" editType="text" enable="true" width="120" align="center" readOnly="true"/>
<EF:EFComboColumn ename="commitStatus" cname="提交状态" width="80" align="center" required="true" <EF:EFComboColumn ename="commitStatus" cname="提交状态" width="80" align="center" required="true"
readonly="true"> readonly="true">
<EF:EFCodeOption codeName="hggp.commitStatus"/> <EF:EFCodeOption codeName="hggp.commitStatus"/>
......
...@@ -49,7 +49,7 @@ function showInfo(planCode) { ...@@ -49,7 +49,7 @@ function showInfo(planCode) {
*/ */
function showUploadFile(id) { function showUploadFile(id) {
JSColorbox.open({ JSColorbox.open({
href: "HGSC099?methodName=initLoad&inqu_status-0-bizType=XMRY&inqu_status-0-matId=" + id, href: "HGSC004D?methodName=initLoad&inqu_status-0-matId=" + id,
title: "<div style='text-align: center;'>附件详情</div>", title: "<div style='text-align: center;'>附件详情</div>",
width: "80%", width: "80%",
height: "80%", height: "80%",
......
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