Commit 4b0a886a by liuyang

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

parents fce16339 f065b2d6
...@@ -184,7 +184,6 @@ public class HGKCTools { ...@@ -184,7 +184,6 @@ public class HGKCTools {
*/ */
public static void putInStorageCheckData(List<HGZL002> hgzl002List) { public static void putInStorageCheckData(List<HGZL002> hgzl002List) {
for(HGZL002 hgzl002 : hgzl002List){ for(HGZL002 hgzl002 : hgzl002List){
AssertUtils.isTrue(hgzl002.getPassQuantity().compareTo(0) <= 0, "合格数量小于等于0!");
AssertUtils.isEmpty(hgzl002.getCompanyCode(), "公司编码不能为空!"); AssertUtils.isEmpty(hgzl002.getCompanyCode(), "公司编码不能为空!");
AssertUtils.isEmpty(hgzl002.getCompanyName(), "公司名称不能为空!"); AssertUtils.isEmpty(hgzl002.getCompanyName(), "公司名称不能为空!");
AssertUtils.isEmpty(hgzl002.getProjCode(), "项目编号不能为空!"); AssertUtils.isEmpty(hgzl002.getProjCode(), "项目编号不能为空!");
...@@ -200,6 +199,8 @@ public class HGKCTools { ...@@ -200,6 +199,8 @@ public class HGKCTools {
*/ */
public static void putInStorageData(List<HGZL002> hgzl002List) { public static void putInStorageData(List<HGZL002> hgzl002List) {
List<HGKC003> hgkc003List = new LinkedList<>(); List<HGKC003> hgkc003List = new LinkedList<>();
//入库校验
putInStorageCheckData(hgzl002List);
setHgkc003Data(hgzl002List,hgkc003List, null, null); setHgkc003Data(hgzl002List,hgkc003List, null, null);
DaoUtils.insertBatch(HGKC003.INSERT,hgkc003List); DaoUtils.insertBatch(HGKC003.INSERT,hgkc003List);
} }
...@@ -232,6 +233,9 @@ public class HGKCTools { ...@@ -232,6 +233,9 @@ public class HGKCTools {
//工序质检单 //工序质检单
hgkc003.setInvQty(new BigDecimal(o.getPassQuantity())); hgkc003.setInvQty(new BigDecimal(o.getPassQuantity()));
} }
if(hgkc003.getInvQty().compareTo(BigDecimal.ZERO) == 0){
return;
}
//单重 //单重
BigDecimal invUnitWeight = HGPZTools.HgPz005.calcUnitWeight(hgpz005); BigDecimal invUnitWeight = HGPZTools.HgPz005.calcUnitWeight(hgpz005);
hgkc003.setInvUnitWeight(invUnitWeight); hgkc003.setInvUnitWeight(invUnitWeight);
......
...@@ -94,9 +94,11 @@ public class HGSCTools { ...@@ -94,9 +94,11 @@ public class HGSCTools {
private static void handleOrderAssignStatus(HGSC006A hgsc006A, AssignStatusEnum orderDetailAssignStatus){ private static void handleOrderAssignStatus(HGSC006A hgsc006A, AssignStatusEnum orderDetailAssignStatus){
List<HGSC006A> otherSc006AList = HGSCTools.THGSC006A.otherById(hgsc006A.getOrderCode(),hgsc006A.getId()); List<HGSC006A> otherSc006AList = HGSCTools.THGSC006A.otherById(hgsc006A.getOrderCode(),hgsc006A.getId());
int assignQuantity = 0;
int unassignQuantity = 0; int unassignQuantity = 0;
int totalQuantity = 0; int totalQuantity = 0;
if(CollectionUtils.isNotEmpty(otherSc006AList)){ if(CollectionUtils.isNotEmpty(otherSc006AList)){
assignQuantity = otherSc006AList.stream().mapToInt(HGSC006A::getAssignQuantity).sum();
unassignQuantity = otherSc006AList.stream().mapToInt(HGSC006A::getUnassignQuantity).sum(); unassignQuantity = otherSc006AList.stream().mapToInt(HGSC006A::getUnassignQuantity).sum();
totalQuantity = otherSc006AList.stream().mapToInt(HGSC006A::getQuantity).sum(); totalQuantity = otherSc006AList.stream().mapToInt(HGSC006A::getQuantity).sum();
} }
...@@ -113,7 +115,7 @@ public class HGSCTools { ...@@ -113,7 +115,7 @@ public class HGSCTools {
orderAssignStatus = PARTIAL_ASSIGN; orderAssignStatus = PARTIAL_ASSIGN;
break; break;
case ASSIGNED: case ASSIGNED:
if(unassignQuantity == totalQuantity){ if(assignQuantity == totalQuantity){
orderAssignStatus = ASSIGNED; orderAssignStatus = ASSIGNED;
}else{ }else{
orderAssignStatus = PARTIAL_ASSIGN; orderAssignStatus = PARTIAL_ASSIGN;
......
...@@ -5,7 +5,6 @@ import com.baosight.hggp.common.CheckStatusEnum; ...@@ -5,7 +5,6 @@ import com.baosight.hggp.common.CheckStatusEnum;
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.kc.tools.HGKCTools; import com.baosight.hggp.hg.kc.tools.HGKCTools;
import com.baosight.hggp.hg.sc.domain.HGSC007;
import com.baosight.hggp.hg.sc.domain.HGSC008; import com.baosight.hggp.hg.sc.domain.HGSC008;
import com.baosight.hggp.hg.sc.tools.HGSCTools; import com.baosight.hggp.hg.sc.tools.HGSCTools;
import com.baosight.hggp.hg.xs.domain.User; import com.baosight.hggp.hg.xs.domain.User;
...@@ -37,8 +36,7 @@ public class ServiceHGZL002 extends ServiceBase { ...@@ -37,8 +36,7 @@ public class ServiceHGZL002 extends ServiceBase {
@OperationLogAnnotation(operModul = "工序质检单", operType = "查询", operDesc = "初始化查询") @OperationLogAnnotation(operModul = "工序质检单", operType = "查询", operDesc = "初始化查询")
public EiInfo initLoad(EiInfo inInfo) { public EiInfo initLoad(EiInfo inInfo) {
try { try {
handleQueryParam(inInfo); inInfo = customQuery(inInfo);
inInfo = super.query(inInfo, HGZL002.QUERY, new HGZL002());
EiInfoUtils.addBlock(inInfo,"userBlockId", UserSessionUtils.getUser(), User.class); EiInfoUtils.addBlock(inInfo,"userBlockId", UserSessionUtils.getUser(), User.class);
} catch (Exception e) { } catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败"); LogUtils.setDetailMsg(inInfo, e, "初始化失败");
...@@ -46,15 +44,21 @@ public class ServiceHGZL002 extends ServiceBase { ...@@ -46,15 +44,21 @@ public class ServiceHGZL002 extends ServiceBase {
return inInfo; return inInfo;
} }
private void handleQueryParam(EiInfo inInfo){ private EiInfo customQuery(EiInfo inInfo){
Long taskId = MapUtils.getLong(EiInfoUtils.getFirstRow(inInfo),HGSC008.FIELD_task_id); Long taskId = MapUtils.getLong(EiInfoUtils.getFirstRow(inInfo),HGSC008.FIELD_task_id);
if(Objects.nonNull(taskId)&&taskId>0){ if(Objects.nonNull(taskId)&&taskId>0){
List<HGSC008> hgsc008s = HGSCTools.THGSC008.getByTaskId(taskId); List<HGSC008> hgsc008s = HGSCTools.THGSC008.getByTaskId(taskId);
List<Long> workIds = Optional.ofNullable(hgsc008s).orElse(new ArrayList<>()).stream().map(HGSC008::getId).collect(Collectors.toList()); List<Long> workIds = Optional.ofNullable(hgsc008s).orElse(new ArrayList<>()).stream().map(HGSC008::getId).collect(Collectors.toList());
if(CollectionUtils.isNotEmpty(workIds)){ if(CollectionUtils.isNotEmpty(workIds)){
EiInfoUtils.setFirstRow(inInfo,"workIds",workIds); EiInfoUtils.setFirstRow(inInfo,"workIds",workIds);
inInfo = super.query(inInfo, HGZL002.QUERY, new HGZL002());
}else{
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGZL002().eiMetadata);
} }
}else{
inInfo = super.query(inInfo, HGZL002.QUERY, new HGZL002());
} }
return inInfo
} }
/** /**
...@@ -67,8 +71,7 @@ public class ServiceHGZL002 extends ServiceBase { ...@@ -67,8 +71,7 @@ public class ServiceHGZL002 extends ServiceBase {
@OperationLogAnnotation(operModul = "工序质检单", operType = "查询", operDesc = "查询") @OperationLogAnnotation(operModul = "工序质检单", operType = "查询", operDesc = "查询")
public EiInfo query(EiInfo inInfo) { public EiInfo query(EiInfo inInfo) {
try { try {
handleQueryParam(inInfo); inInfo = customQuery(inInfo);
inInfo = super.query(inInfo, HGZL002.QUERY, new HGZL002());
} catch (Exception e) { } catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败"); LogUtils.setDetailMsg(inInfo, e, "查询失败");
} }
...@@ -80,8 +83,6 @@ public class ServiceHGZL002 extends ServiceBase { ...@@ -80,8 +83,6 @@ public class ServiceHGZL002 extends ServiceBase {
public EiInfo save(EiInfo inInfo) { public EiInfo save(EiInfo inInfo) {
try { try {
List<HGZL002> hgzl002List = MapUtils.toDaoEPBase(inInfo,HGZL002.class); List<HGZL002> hgzl002List = MapUtils.toDaoEPBase(inInfo,HGZL002.class);
//入库校验
HGKCTools.HgKc003.putInStorageCheckData(hgzl002List);
hgzl002List.forEach( o -> { hgzl002List.forEach( o -> {
o.setCheckStatus(CheckStatusEnum.CHECKED.getCode()); o.setCheckStatus(CheckStatusEnum.CHECKED.getCode());
DaoUtils.update(HGZL002.UPDATE,o); DaoUtils.update(HGZL002.UPDATE,o);
......
...@@ -49,8 +49,9 @@ $(function () { ...@@ -49,8 +49,9 @@ $(function () {
onCheckRow: function (e){ onCheckRow: function (e){
if(e.checked){ if(e.checked){
if(e.model.checkStatus === '0') { if(e.model.checkStatus === '0') {
var now = new Date() var now = new Date();
resultGrid.setCellValue(e.row, "checkDate", now.getFullYear() + "-" + now.getMonth() + "-" + now.getDay()); var nowStr = now.getFullYear() + "-" + String(now.getMonth() + 1).padStart(2, '0') + "-" + String(now.getDate()).padStart(2, '0');
resultGrid.setCellValue(e.row, "checkDate", nowStr);
} }
resultGrid.setCellValue(e.row, "checkBy", loginUser[0].userId); resultGrid.setCellValue(e.row, "checkBy", loginUser[0].userId);
resultGrid.setCellValue(e.row, "checkName", loginUser[0].userName); resultGrid.setCellValue(e.row, "checkName", loginUser[0].userName);
...@@ -114,6 +115,7 @@ let save = function () { ...@@ -114,6 +115,7 @@ let save = function () {
message("第" + (i + 1) + "行不合格数量不能大于报工数量!"); message("第" + (i + 1) + "行不合格数量不能大于报工数量!");
return; return;
} }
} }
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做质检完成操作吗? ", { JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做质检完成操作吗? ", {
ok: function () { ok: function () {
......
...@@ -196,7 +196,8 @@ function selectTask(){ ...@@ -196,7 +196,8 @@ function selectTask(){
height: "90%", height: "90%",
callbackName: function (row) { callbackName: function (row) {
var now = new Date(); var now = new Date();
row.checkDate = now.getFullYear() + "-" + now.getMonth() + "-" + now.getDay(); var nowStr = now.getFullYear() + "-" + String(now.getMonth() + 1).padStart(2, '0') + "-" + String(now.getDate()).padStart(2, '0');
row.checkDate = nowStr;
row.taskId = row.id; row.taskId = row.id;
row.id = ""; row.id = "";
row.checkBy = loginUser[0].userId; row.checkBy = loginUser[0].userId;
......
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