Commit dc9a9fd2 by wuwenlong

派工状态bugfix

parent cc1dd8e4
...@@ -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); 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,14 +44,19 @@ public class ServiceHGZL002 extends ServiceBase { ...@@ -46,14 +44,19 @@ public class ServiceHGZL002 extends ServiceBase {
return inInfo; return inInfo;
} }
private void handleQueryParam(EiInfo inInfo){ private void 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());
} }
} }
...@@ -67,8 +70,7 @@ public class ServiceHGZL002 extends ServiceBase { ...@@ -67,8 +70,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); customQuery(inInfo);
inInfo = super.query(inInfo, HGZL002.QUERY, new HGZL002());
} catch (Exception e) { } catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败"); LogUtils.setDetailMsg(inInfo, e, "查询失败");
} }
......
...@@ -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