Commit 4d473550 by liulei

下料登记优化

parent 07b96c3c
......@@ -386,6 +386,7 @@ public class HPSC007 extends DaoEPBase {
}
/**
* get the value from Map.
*
......
......@@ -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;
}
}
}
......@@ -70,7 +70,6 @@
<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:EFOption label=" " value=""/>
<EF:EFOptions blockId="factory_record_block_id" valueField="valueField" textField="textField"/>
</EF:EFComboColumn>
<EF:EFColumn ename="orgNo" cname="生产组" width="110" align="center" readonly="true"/>
......
......@@ -42,7 +42,7 @@
<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"
......
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