Commit 43c7eb17 by 宋祥

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

parents 38fffe2d fbe06779
......@@ -507,4 +507,16 @@ public class HGConstant {
// 已提交
public static final Integer S1 = 1;
}
// 报工状态
public static class BGStatus {
// 未报工
public static final Integer S0 = 0;
// 部分报工
public static final Integer S1 = 1;
// 已报工
public static final Integer S2 = 2;
//超报工
public static final Integer S3 = 3;
}
}
......@@ -69,6 +69,8 @@ public class HGSC007 extends DaoEPBase {
public static final String FIELD_IS_COMPLTE = "isComplete";
public static final String FIELD_TASK_QUANTITY = "taskQuantity";
public static final String FIELD_UN_TASK_QUANTITY = "unTaskQuantity";
public static final String FIELD_STATUS = "status";
public static final String FIELD_REGISTER_NUM = "registerNum";
public static final String COL_id = "id";
......@@ -171,6 +173,8 @@ public class HGSC007 extends DaoEPBase {
private Integer isComplete = new Integer(0); /* 是否完工 0-未报工 1-部分报工 2-已报工*/
private BigDecimal taskQuantity = new BigDecimal("0");
private BigDecimal unTaskQuantity = new BigDecimal("0");
private Integer status = new Integer(0); /* 报工状态*/
private BigDecimal registerNum = new BigDecimal("0");
/**
......@@ -388,6 +392,16 @@ public class HGSC007 extends DaoEPBase {
eiColumn.setDescName("待报工数量");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_STATUS);
eiColumn.setDescName("报工状态");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_REGISTER_NUM);
eiColumn.setType("N");
eiColumn.setScaleLength(0);
eiColumn.setFieldLength(20);
eiColumn.setDescName("报工数量");
eiMetadata.addMeta(eiColumn);
}
/**
......@@ -1094,6 +1108,22 @@ public class HGSC007 extends DaoEPBase {
this.unTaskQuantity = unTaskQuantity;
}
public Integer getStatus() {
return status;
}
public void setStatus(Integer status) {
this.status = status;
}
public BigDecimal getRegisterNum() {
return registerNum;
}
public void setRegisterNum(BigDecimal registerNum) {
this.registerNum = registerNum;
}
/**
* get the value from Map.
*
......@@ -1148,6 +1178,8 @@ public class HGSC007 extends DaoEPBase {
setIsComplete(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_IS_COMPLTE)), isComplete));
setTaskQuantity(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_TASK_QUANTITY)), taskQuantity));
setUnTaskQuantity(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_UN_TASK_QUANTITY)), unTaskQuantity));
setStatus(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_STATUS)), status));
setRegisterNum(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_REGISTER_NUM)), registerNum));
}
......@@ -1204,6 +1236,8 @@ public class HGSC007 extends DaoEPBase {
map.put(FIELD_IS_COMPLTE, StringUtils.toString(isComplete, eiMetadata.getMeta(FIELD_IS_COMPLTE)));
map.put(FIELD_TASK_QUANTITY, StringUtils.toString(taskQuantity, eiMetadata.getMeta(FIELD_TASK_QUANTITY)));
map.put(FIELD_UN_TASK_QUANTITY, StringUtils.toString(unTaskQuantity, eiMetadata.getMeta(FIELD_UN_TASK_QUANTITY)));
map.put(FIELD_STATUS, StringUtils.toString(status, eiMetadata.getMeta(FIELD_STATUS)));
map.put(FIELD_REGISTER_NUM, StringUtils.toString(registerNum, eiMetadata.getMeta(FIELD_REGISTER_NUM)));
return map;
}
......
......@@ -45,7 +45,9 @@
updated_name as "updatedName", <!-- 修改人名称 -->
updated_time as "updatedTime", <!-- 更新时间 -->
LENGTH as "length", <!-- 长 -->
SPEC as "spec" <!-- 规格 -->
SPEC as "spec", <!-- 规格 -->
STATUS as "status",
REGISTER_NUM as "registerNum"
</sql>
<sql id="condition">
......@@ -170,6 +172,12 @@
<isNotEmpty prepend=" AND " property="updatedTime">
updated_time = #updatedTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="status">
STATUS = #status#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="registerNum">
REGISTER_NUM = #registerNum#
</isNotEmpty>
</sql>
<sql id="customCondition">
......@@ -741,14 +749,16 @@
updated_name, <!-- 修改人名称 -->
updated_time, <!-- 更新时间 -->
spec,
length
length,
STATUS,
REGISTER_NUM
) VALUES (
#matId#, #orderId#, #orderDetailId#, #techFlowId#, #techFlowName#, #inventProcessId#,
#processCode#, #processName#, #processOrder#, #companyCode#, #companyName#, #depCode#, #depName#, #projCode#,
#projName#, #taskCode#, #productType#, #productCode#, #productName#, #planStartDate#, #planEndDate#,
#factoryCode#, #factoryName#, #groupCode#, #groupName#, #completeDate#, #quantity#, #finishQuantity#,
#unfinishQuantity#, #singleWeight#, #totalWeight#, #finishWeight#, #unfinishWeight#, #accountCode#, #createdBy#,
#createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#, #spec#, #length#
#createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#, #spec#, #length#, #status#, #registerNum#
)
</insert>
......@@ -796,7 +806,9 @@
updated_name = #updatedName#, <!-- 修改人名称 -->
updated_time = #updatedTime#, <!-- 更新时间 -->
spec = #spec#,
length = #length#
length = #length#,
STATUS = #status#,
REGISTER_NUM = #registerNum#
WHERE id = #id#
</update>
......
......@@ -1679,17 +1679,35 @@ public class HGSCTools {
Map resultMap = EiInfoUtils.getFirstRow(info, EiConstant.resultBlock);
String taskId = MapUtils.getString(resultMap, HGSC008.FIELD_task_id);
HGSC007 hgsc007 = HGSCTools.THGSC007.getById(Long.valueOf(taskId));
BigDecimal quantity = MapUtils.getBigDecimal(resultMap, HGSC008.FIELD_quantity);
BigDecimal singleWeight = MapUtils.getBigDecimal(resultMap, HGSC008.FIELD_single_weight);
BigDecimal totalWeight = singleWeight.multiply(quantity);
BigDecimal unregisterQuantity = MapUtils.getBigDecimal(resultMap, HGSC008.FIELD_unregister_quantity).subtract(quantity);
BigDecimal registeredQuantity = MapUtils.getBigDecimal(resultMap, HGSC008.FIELD_registered_quantity).add(quantity);
HGSC008 hgsc008 = new HGSC008();
BeanUtils.copyProperties(hgsc007, hgsc008);
cleanBaseInfo(hgsc008);
hgsc008.setTaskId(hgsc007.getId());
hgsc008.setQuantity(MapUtils.getBigDecimal(resultMap, HGSC008.FIELD_quantity));
hgsc008.setQuantity(quantity);
hgsc008.setRegisterDate(String.valueOf(resultMap.get(HGSC008.FIELD_register_date)));
hgsc008.setExceedReason(resultMap.get(HGSC008.FIELD_exceed_reason).toString());
hgsc008.setTotalWeight(hgsc007.getSingleWeight().multiply(hgsc008.getQuantity()));
hgsc008.setTotalWeight(totalWeight);
checkAddDate(hgsc008);
hgsc008.setWorkCode(SequenceGenerator.getNextSequence(HGConstant.SequenceId.HGSC008_WORK_CODE));
DaoUtils.insert(HGSC008.INSERT, hgsc008);
hgsc007.setRegisterNum(registeredQuantity);
if (unregisterQuantity.compareTo(BigDecimal.ZERO) < 0){
hgsc007.setStatus(HGConstant.BGStatus.S3);
} else if (unregisterQuantity.compareTo(BigDecimal.ZERO) == 0){
hgsc007.setStatus(HGConstant.BGStatus.S2);
}else if (unregisterQuantity.compareTo(BigDecimal.ZERO) > 0){
hgsc007.setStatus(HGConstant.BGStatus.S1);
}else {
hgsc007.setStatus(HGConstant.BGStatus.S0);
}
DaoUtils.update(HGSC007.UPDATE, hgsc007);
HGZLTools.THGZL002.add(hgsc008);
return hgsc008;
}
......
......@@ -52,6 +52,10 @@
<EF:EFColumn ename="quantity" cname="任务数量" width="100" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="finishQuantity" cname="完工数量" width="100" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="unfinishQuantity" cname="未完工数量" width="100" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="registerNum" cname="已报工数量" width="100" enable="false" readonly="true" align="center"/>
<EF:EFComboColumn ename="status" cname="报工状态" width="80" align="center" readonly="true">
<EF:EFCodeOption codeName="hggp.hgsc.status"/>
</EF:EFComboColumn>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
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