Commit e2197c6e by 宋祥

Merge remote-tracking branch 'origin/dev' into dev

parents b868c2fe 4d473550
......@@ -386,6 +386,7 @@ public class HPSC007 extends DaoEPBase {
}
/**
* get the value from Map.
*
......
......@@ -62,7 +62,7 @@ public class ServiceHPSC005C extends ServiceBase {
public EiInfo query(EiInfo inInfo) {
try {
Map queryRow = EiInfoUtils.getFirstRow(inInfo);
inInfo = super.query(inInfo, HPSC005.QUERY, new HPSC005());
inInfo = super.query(inInfo, HPSC005C.QUERY, new HPSC005C());
} catch (Throwable e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
......
......@@ -4,12 +4,14 @@ import cn.hutool.core.bean.BeanUtil;
import com.baosight.hpjx.aspect.annotation.OperationLogAnnotation;
import com.baosight.hpjx.common.DdynamicEnum;
import com.baosight.hpjx.common.HPConstants;
import com.baosight.hpjx.common.ProdOrderStatusEnum;
import com.baosight.hpjx.core.constant.CommonConstant;
import com.baosight.hpjx.core.dao.DaoUtils;
import com.baosight.hpjx.hp.constant.HPConstant;
import com.baosight.hpjx.hp.pz.domain.HPPZ011;
import com.baosight.hpjx.hp.pz.tools.HPPZTools;
import com.baosight.hpjx.hp.sc.domain.*;
import com.baosight.hpjx.util.AssertUtils;
import com.baosight.hpjx.util.CommonMethod;
import com.baosight.hpjx.util.LogUtils;
import com.baosight.iplat4j.core.ei.EiBlock;
......@@ -111,7 +113,10 @@ public class ServiceHPSC006 extends ServiceBase {
HPSC006.setStatus(CommonConstant.YesNo.NO_0.intValue());
HPSC006.setTotalWt(totalWt);
HPSC006.setInventCode(HPPZTools.checkAndSavePZ04(HPSC006.getInventType(),HPSC006.getInventName()));
HPSC006.setStatus(1);
if(HPSC006.getFactoryCode()!=null && !(HPSC006.getFactoryCode().equals(" "))) {
AssertUtils.isEmpty(HPSC006.getOrgNo(), "已选择厂区,下料组不能为空");
HPSC006.setStatus(1);
}
DaoUtils.insert("HPSC006.insert",HPSC006);
}
inInfo.setStatus(EiConstant.STATUS_SUCCESS);
......
......@@ -6,6 +6,7 @@ import com.baosight.hpjx.core.constant.CommonConstant;
import com.baosight.hpjx.core.dao.DaoUtils;
import com.baosight.hpjx.core.security.UserSessionUtils;
import com.baosight.hpjx.hp.constant.HPConstant;
import com.baosight.hpjx.hp.sc.domain.HPSC004;
import com.baosight.hpjx.hp.sc.domain.HPSC005;
import com.baosight.hpjx.hp.sc.domain.HPSC006;
import com.baosight.hpjx.hp.sc.domain.HPSC007;
......@@ -96,11 +97,17 @@ public class ServiceHPSC007 extends ServiceBase {
DaoUtils.insert("HPSC007.insert",HPSC007);
}
// 修改下料表中的字段
HPSC006.setActualCompletionNum(HPSC006.getActualCompletionNum().add(totalNum));
HPSC006.setActualCompletionTotalWt(HPSC006.getActualCompletionTotalWt().add(actualCompletionTotalWt));
if (HPSC006.getActualCompletionNum().compareTo(HPSC006.getNum()) >= 0) {
Map queryMap = new HashMap();
queryMap.put("hpsc006Id", HPSC006.getId());
List<HPSC007> Hpsc007 = this.dao.query("HPSC007.query",queryMap);
String maxPlanCompletionDate = Hpsc007.stream().map(com.baosight.hpjx.hp.sc.domain.HPSC007::getActualCompletionDate).max(String::compareTo)
.orElse("");
HPSC006.setStatus(2);
HPSC006.setActualCompletionDate(DateUtils.shortDateTime());
HPSC006.setActualCompletionDate(maxPlanCompletionDate);
}
HPSCTools.Hpsc006.updateCompleteNum(HPSC006.getId(),HPSC006.getActualCompletionNum(),HPSC006.getActualCompletionTotalWt(),
HPSC006.getStatus(),HPSC006.getActualCompletionDate());
......@@ -157,8 +164,13 @@ public class ServiceHPSC007 extends ServiceBase {
HPSC006.setActualCompletionNum(HPSC006.getActualCompletionNum().add(totalNum));
HPSC006.setActualCompletionTotalWt(HPSC006.getActualCompletionTotalWt().add(actualCompletionTotalWt));
if (HPSC006.getActualCompletionNum().compareTo(HPSC006.getNum()) >= 0) {
Map queryMap = new HashMap();
queryMap.put("hpsc006Id", HPSC006.getId());
List<HPSC007> Hpsc007 = this.dao.query("HPSC007.query",queryMap);
String maxPlanCompletionDate = Hpsc007.stream().map(com.baosight.hpjx.hp.sc.domain.HPSC007::getActualCompletionDate).max(String::compareTo)
.orElse("");
HPSC006.setStatus(2);
HPSC006.setActualCompletionDate(DateUtils.shortDateTime());
HPSC006.setActualCompletionDate(maxPlanCompletionDate);
} else {
HPSC006.setStatus(1);
HPSC006.setActualCompletionDate(" ");
......
......@@ -96,6 +96,36 @@
</select>
<select id="queryList" parameterClass="java.util.HashMap"
resultClass="java.util.List">
SELECT
ID as "id",
COMPANY_CODE as "companyCode", <!-- 企业编码 预留 -->
HPSC006_ID as "hpsc006Id", <!-- 生产下料ID -->
ACTUAL_COMPLETION_DATE as "actualCompletionDate", <!-- 实际完工日期 -->
ACTUAL_COMPLETION_NUM as "actualCompletionNum", <!-- 实际完工数量 -->
ACTUAL_COMPLETION_TOTAL_WT as "actualCompletionTotalWt", <!-- 实际完工重量 -->
USER_ID as "userId", <!-- 完成人ID -->
USER_NAME as "userName", <!-- 完成人姓名 -->
CREATED_BY as "createdBy", <!-- 创建人 -->
CREATED_TIME as "createdTime", <!-- 创建时间 -->
UPDATED_BY as "updatedBy", <!-- 更新人 -->
UPDATED_TIME as "updatedTime", <!-- 更新时间 -->
DEP_CODE as "depCode", <!-- 部门编码 -->
REMARK as "remark" <!-- 备注 -->
FROM ${hpjxSchema}.T_HPSC007 WHERE 1=1
<include refid="condition" />
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
ID asc
</isEmpty>
</dynamic>
</select>
<select id="count" resultClass="int">
SELECT COUNT(*) FROM ${hpjxSchema}.T_HPSC007 WHERE 1=1
<include refid="condition" />
......
......@@ -792,13 +792,28 @@ public class HPSCTools {
* @param id
* @return
*/
public static HPSC007 getById(Long id) {
public static List<HPSC007> getById(Long id) {
AssertUtils.isNull(id, "生产下料ID不能为空");
Map queryMap = new HashMap();
queryMap.put("id", id);
List<HPSC007> results = DaoBase.getInstance().query(HPSC007.QUERY, queryMap);
AssertUtils.isNull(results, String.format("生产下料ID[%s]信息不存在", id));
return results.get(0);
return results;
}
/**
* 查询
*
* @param
* @return
*/
public static List<HPSC007> getBy006Id(Long id) {
AssertUtils.isNull(id, "生产下料ID不能为空");
Map queryMap = new HashMap();
queryMap.put("hpsc006Id", id);
List<HPSC007> results = DaoBase.getInstance().query(HPSC007.QUERY, queryMap);
AssertUtils.isNull(results, String.format("生产下料ID[%s]信息不存在", id));
return results;
}
}
}
......@@ -68,6 +68,11 @@
<EF:EFColumn ename="num" width="80" cname="数量"/>
<EF:EFColumn ename="unitWt" format="{0:N3}" width="80" cname="单重"/>
<EF:EFColumn enable="false" format="{0:N3}" ename="totalWt" width="80" cname="总重"/>
<EF:EFComboColumn ename="factoryCode" cname="厂区" width="110" align="center"
filter="contains" readonly="true">
<EF:EFOptions blockId="factory_record_block_id" valueField="valueField" textField="textField"/>
</EF:EFComboColumn>
<EF:EFColumn ename="orgNo" cname="生产组" width="110" align="center" readonly="true"/>
<EF:EFColumn ename="planCompletionDate" required='true' cname="计划完成时间" editType="date"
dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" width="120"/>
<EF:EFColumn ename="actualCompletionDate" cname="实际完成时间" editType="date"
......@@ -79,13 +84,7 @@
<EF:EFOption label="生产中" value="1"/>
<EF:EFOption label="已完成" value="2"/>
</EF:EFComboColumn>
<EF:EFComboColumn ename="factoryCode" cname="厂区" width="110" align="center" required="true"
filter="contains" readonly="true">
<EF:EFOptions blockId="factory_record_block_id" valueField="valueField" textField="textField"/>
</EF:EFComboColumn>
<EF:EFColumn enable="false" ename="factoryName" cname="厂区名称" hidden="true"/>
<EF:EFColumn ename="orgNo" cname="生产组" width="110" align="center" required="true" readonly="true"/>
<EF:EFColumn enable="false" ename="orgName" cname="生产组" hidden="true"/>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
......
......@@ -7,31 +7,29 @@
<EF:EFPage title="下料登记">
<EF:EFRegion id="inqu" title="订单详情">
<EF:EFInput ename="detail-0-id" type="hidden"/>
<EF:EFInput ename="inqu_status-0-hpsc006Id" type="hidden"/>
<EF:EFInput ename="detail-0-id" type="hidden"/>
<div class="row">
<EF:EFInput ename="detail-0-projCode" cname="项目号" colWidth="4" readonly="true"/>
<EF:EFInput ename="detail-0-projName" cname="项目名称" colWidth="4" readonly="true"/>
</div>
<div class="row">
<EF:EFInput ename="detail-0-prdtName" cname="部件名称" colWidth="4" readonly="true"/>
<EF:EFInput ename="detail-0-partName" cname="零件名称" colWidth="4" readonly="true"/>
</div>
<div class="row">
<EF:EFInput ename="detail-0-partName" cname="零件名称" colWidth="4" readonly="true"/>
<EF:EFInput ename="detail-0-partName" cname="零部件名称" colWidth="4" readonly="true"/>
<EF:EFInput ename="detail-0-inventName" cname="材料名称" colWidth="4" readonly="true"/>
<EF:EFInput ename="detail-0-num" cname="计划数量" colWidth="4" readonly="true"/>
</div>
<div class="row">
<EF:EFInput ename="detail-0-num" cname="计划数量" colWidth="4" readonly="true"/>
<EF:EFInput ename="detail-0-unitWt" cname="单重" colWidth="4" readonly="true"/>
<EF:EFInput ename="detail-0-totalWt" cname="计划重量" colWidth="4" readonly="true"/>
</div>
<div class="row">
<EF:EFInput ename="detail-0-actualCompletionNum" cname="完工数量" colWidth="4" readonly="true"/>
<EF:EFInput ename="detail-0-actualCompletionUnitWt" cname="完工重量" colWidth="4" readonly="true"/>
</div>
<div class="row">
<EF:EFInput ename="detail-0-actualCompletionTotalWt" cname="完工重量" colWidth="4" readonly="true"/>
<EF:EFInput ename="detail-0-planCompletionDate" cname="计划完成日期" colWidth="4" readonly="true"/>
</div>
<div class="row">
<EF:EFSelect ename="detail-0-status" cname="状态" colWidth="4" readonly="true">
<EF:EFOption label="计划中" value="0"/>
<EF:EFOption label="生产中" value="1"/>
......@@ -44,7 +42,8 @@
<EF:EFInput ename="productionOrderNo" type="hidden"/>
<EF:EFGrid blockId="result" autoDraw="override" checkMode="row">
<EF:EFColumn ename="id" cname="主键" hidden="true"/>
<EF:EFColumn ename="actualCompletionDate" required='true' cname="完成日期" dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" />
<EF:EFColumn ename="actualCompletionDate" editType="date" cname="完成日期" dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" />
<EF:EFColumn ename="hpsc006Id" cname="生产下料ID" hidden="true"/>
<EF:EFPopupColumn ename="userId" cname="完成人" popupType="ServiceGrid"
popupTitle="人员信息" serviceName="HPXSUser" methodName="queryComboBox" resultId="user_block_id"
columnEnames="textField,valueField"
......
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