fix: 自动下发任务修改时间长导致覆盖了排产确认的状态
This commit is contained in:
@@ -40,7 +40,11 @@ public class SecurityUtils {
|
|||||||
* @return 系统用户名称
|
* @return 系统用户名称
|
||||||
*/
|
*/
|
||||||
public static String getCurrentUsername() {
|
public static String getCurrentUsername() {
|
||||||
return getCurrentUser().getUsername();
|
CurrentUser currentUser = getCurrentUser();
|
||||||
|
if (currentUser == null) {
|
||||||
|
return "default";
|
||||||
|
}
|
||||||
|
return currentUser.getUsername();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -49,7 +53,11 @@ public class SecurityUtils {
|
|||||||
* @return 系统用户名称
|
* @return 系统用户名称
|
||||||
*/
|
*/
|
||||||
public static String getCurrentNickName() {
|
public static String getCurrentNickName() {
|
||||||
return getCurrentUser().getPresonName();
|
CurrentUser currentUser = getCurrentUser();
|
||||||
|
if (currentUser == null) {
|
||||||
|
return "默认系统";
|
||||||
|
}
|
||||||
|
return currentUser.getPresonName();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -58,7 +66,11 @@ public class SecurityUtils {
|
|||||||
* @return 系统用户Id
|
* @return 系统用户Id
|
||||||
*/
|
*/
|
||||||
public static String getCurrentUserId() {
|
public static String getCurrentUserId() {
|
||||||
return getCurrentUser().getId();
|
CurrentUser currentUser = getCurrentUser();
|
||||||
|
if (currentUser == null) {
|
||||||
|
return "99";
|
||||||
|
}
|
||||||
|
return currentUser.getId();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -85,5 +85,6 @@ public class AutoIssueWorkOrder {
|
|||||||
pdmBdWorkorder.setWorkorder_status(WorkOrderStatusEnum.ISSUED.getCode());
|
pdmBdWorkorder.setWorkorder_status(WorkOrderStatusEnum.ISSUED.getCode());
|
||||||
TaskUtils.setWorkOrderUpdateByAcs(pdmBdWorkorder);
|
TaskUtils.setWorkOrderUpdateByAcs(pdmBdWorkorder);
|
||||||
workorderService.updateById(pdmBdWorkorder);
|
workorderService.updateById(pdmBdWorkorder);
|
||||||
|
log.info("自动下发工单「 " + pdmBdWorkorder.getWorkorder_code() + " 」成功!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -569,11 +569,17 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
|||||||
if (bdWorkorder == null) {
|
if (bdWorkorder == null) {
|
||||||
return BaseResponse.responseError(requestNo, "未找到工单号[" + workorderCode + "]的记录!");
|
return BaseResponse.responseError(requestNo, "未找到工单号[" + workorderCode + "]的记录!");
|
||||||
}
|
}
|
||||||
bdWorkorder.setWorkorder_status(WorkOrderStatusEnum.PRODUCING.getCode());
|
if (!bdWorkorder.getWorkorder_status().equals(WorkOrderStatusEnum.ISSUED.getCode())) {
|
||||||
bdWorkorder.setRealproducestart_date(DateUtil.now());
|
return BaseResponse.responseError(requestNo, "系统繁忙,请稍后再试!");
|
||||||
TaskUtils.setWorkOrderUpdateByAcs(bdWorkorder);
|
}
|
||||||
workorderService.updateById(bdWorkorder);
|
PdmBdWorkorder upObj = new PdmBdWorkorder();
|
||||||
log.info("人工排产确认:{}", bdWorkorder);
|
upObj.setWorkorder_status(WorkOrderStatusEnum.PRODUCING.getCode());
|
||||||
|
upObj.setRealproducestart_date(DateUtil.now());
|
||||||
|
TaskUtils.setWorkOrderUpdateByAcs(upObj);
|
||||||
|
workorderService.update(upObj, new LambdaQueryWrapper<PdmBdWorkorder>()
|
||||||
|
.eq(PdmBdWorkorder::getWorkorder_code, bdWorkorder.getWorkorder_code()));
|
||||||
|
log.info("人工排产确认:{}, 作为更新的工单数据:{}", param, upObj);
|
||||||
|
log.info("人工排产确认工单「 " + bdWorkorder.getWorkorder_code() + " 」成功!");
|
||||||
return BaseResponse.responseOk(requestNo);
|
return BaseResponse.responseOk(requestNo);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -75,6 +75,7 @@ public class PdmBdWorkorderController {
|
|||||||
|
|
||||||
@PutMapping
|
@PutMapping
|
||||||
@Log("修改工单管理")
|
@Log("修改工单管理")
|
||||||
|
@Limit(period = 2, count = 1)
|
||||||
//@SaCheckPermission("@el.check('pdmBdWorkorder:edit')")
|
//@SaCheckPermission("@el.check('pdmBdWorkorder:edit')")
|
||||||
public ResponseEntity<Object> update(@Validated @RequestBody PdmBdWorkorder entity) {
|
public ResponseEntity<Object> update(@Validated @RequestBody PdmBdWorkorder entity) {
|
||||||
pdmBdWorkorderService.update(entity);
|
pdmBdWorkorderService.update(entity);
|
||||||
|
|||||||
@@ -23,28 +23,20 @@ public class PdmBdWorkorder implements Serializable {
|
|||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
@TableId(value = "workorder_id", type = IdType.NONE)
|
@TableId(value = "workorder_id", type = IdType.NONE)
|
||||||
|
|
||||||
private String workorder_id;
|
private String workorder_id;
|
||||||
|
|
||||||
|
|
||||||
private String workorder_code;
|
private String workorder_code;
|
||||||
|
|
||||||
|
|
||||||
private BigDecimal plan_qty;
|
private BigDecimal plan_qty;
|
||||||
|
|
||||||
|
|
||||||
private BigDecimal real_qty;
|
private BigDecimal real_qty;
|
||||||
|
|
||||||
|
|
||||||
private BigDecimal plan_weight;
|
private BigDecimal plan_weight;
|
||||||
|
|
||||||
|
|
||||||
private BigDecimal real_weight;
|
private BigDecimal real_weight;
|
||||||
|
|
||||||
|
|
||||||
private String material_id;
|
private String material_id;
|
||||||
|
|
||||||
|
|
||||||
private String raw_material_code;
|
private String raw_material_code;
|
||||||
|
|
||||||
private String produce_order;
|
private String produce_order;
|
||||||
@@ -55,84 +47,58 @@ public class PdmBdWorkorder implements Serializable {
|
|||||||
|
|
||||||
private String produce_date;
|
private String produce_date;
|
||||||
|
|
||||||
|
|
||||||
private String vehicle_type;
|
private String vehicle_type;
|
||||||
|
|
||||||
|
|
||||||
private String planproducestart_date;
|
private String planproducestart_date;
|
||||||
|
|
||||||
|
|
||||||
private String planproduceend_date;
|
private String planproduceend_date;
|
||||||
|
|
||||||
|
|
||||||
private String realproducestart_date;
|
private String realproducestart_date;
|
||||||
|
|
||||||
|
|
||||||
private String realproduceend_date;
|
private String realproduceend_date;
|
||||||
|
|
||||||
|
|
||||||
private Integer standing_time;
|
private Integer standing_time;
|
||||||
|
|
||||||
|
|
||||||
private String point_code;
|
private String point_code;
|
||||||
|
|
||||||
|
|
||||||
private String point_name;
|
private String point_name;
|
||||||
|
|
||||||
|
|
||||||
private String region_code;
|
private String region_code;
|
||||||
|
|
||||||
|
|
||||||
private String region_name;
|
private String region_name;
|
||||||
|
|
||||||
|
|
||||||
private String workorder_status;
|
private String workorder_status;
|
||||||
|
|
||||||
|
|
||||||
private Boolean is_needmove;
|
private Boolean is_needmove;
|
||||||
|
|
||||||
|
|
||||||
private String workorder_type;
|
private String workorder_type;
|
||||||
|
|
||||||
|
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
private String production_order;
|
private String production_order;
|
||||||
|
|
||||||
|
|
||||||
private String passback_status;
|
private String passback_status;
|
||||||
|
|
||||||
|
|
||||||
private String workshop_code;
|
private String workshop_code;
|
||||||
|
|
||||||
|
|
||||||
private String ext_id;
|
private String ext_id;
|
||||||
|
|
||||||
private String ext_data;
|
private String ext_data;
|
||||||
|
|
||||||
|
|
||||||
private Boolean is_delete;
|
private Boolean is_delete;
|
||||||
|
|
||||||
|
|
||||||
private String create_id;
|
private String create_id;
|
||||||
|
|
||||||
|
|
||||||
private String create_name;
|
private String create_name;
|
||||||
|
|
||||||
|
|
||||||
private String create_time;
|
private String create_time;
|
||||||
|
|
||||||
|
|
||||||
private String update_id;
|
private String update_id;
|
||||||
|
|
||||||
|
|
||||||
private String update_name;
|
private String update_name;
|
||||||
|
|
||||||
|
|
||||||
private String update_time;
|
private String update_time;
|
||||||
|
|
||||||
|
|
||||||
private Boolean is_urgent;
|
private Boolean is_urgent;
|
||||||
|
|
||||||
private String operator;
|
private String operator;
|
||||||
|
|
||||||
private Integer qualified_qty;
|
private Integer qualified_qty;
|
||||||
|
|||||||
@@ -152,12 +152,12 @@ public class PdmBdWorkorderServiceImpl extends ServiceImpl<PdmBdWorkorderMapper,
|
|||||||
if (dto == null) {
|
if (dto == null) {
|
||||||
throw new BadRequestException("被删除或无权限,操作失败!");
|
throw new BadRequestException("被删除或无权限,操作失败!");
|
||||||
}
|
}
|
||||||
|
// 使用最新的状态
|
||||||
String now = DateUtil.now();
|
entity.setWorkorder_status(dto.getWorkorder_status());
|
||||||
entity.setUpdate_id(GeneralDefinition.ACS_ID);
|
entity.setUpdate_id(GeneralDefinition.ACS_ID);
|
||||||
entity.setUpdate_name(GeneralDefinition.ACS_NAME);
|
entity.setUpdate_name(GeneralDefinition.ACS_NAME);
|
||||||
entity.setUpdate_time(now);
|
entity.setUpdate_time(DateUtil.now());
|
||||||
|
log.info("用户「{}」在PC触发更新工单,更新数据:{},数据库旧数据:{}", SecurityUtils.getCurrentNickName(), entity, dto);
|
||||||
pdmBdWorkorderMapper.updateById(entity);
|
pdmBdWorkorderMapper.updateById(entity);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user