代码修改
This commit is contained in:
@@ -23,6 +23,7 @@ import cn.hutool.core.util.ObjectUtil;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.modules.common.config.RsaProperties;
|
||||
import org.nl.modules.common.exception.BadRequestException;
|
||||
import org.nl.modules.common.utils.PageUtil;
|
||||
@@ -39,6 +40,7 @@ import org.nl.modules.system.service.UserService;
|
||||
import org.nl.modules.system.service.dto.RoleSmallDto;
|
||||
import org.nl.modules.system.service.dto.UserDto;
|
||||
import org.nl.modules.system.service.dto.UserQueryCriteria;
|
||||
import org.slf4j.MDC;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.data.redis.core.StringRedisTemplate;
|
||||
@@ -62,6 +64,7 @@ import java.util.stream.Collectors;
|
||||
* @date 2018-11-23
|
||||
*/
|
||||
@Api(tags = "系统:用户管理")
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/api/users")
|
||||
@RequiredArgsConstructor
|
||||
@@ -84,6 +87,12 @@ public class UserController {
|
||||
@GetMapping
|
||||
@SaCheckPermission("user:list")
|
||||
public ResponseEntity<Object> query(UserQueryCriteria criteria, Pageable pageable){
|
||||
try {
|
||||
MDC.put("log_file_type", "init");
|
||||
log.debug("测试.................");
|
||||
} finally {
|
||||
MDC.remove("log_file_type");
|
||||
}
|
||||
if (!ObjectUtils.isEmpty(criteria.getDeptId())) {
|
||||
criteria.getDeptIds().add(criteria.getDeptId());
|
||||
criteria.getDeptIds().addAll(deptService.getDeptChildren(deptService.findByPid(criteria.getDeptId())));
|
||||
|
||||
@@ -102,4 +102,6 @@ public class MaterialbaseDto implements Serializable {
|
||||
private Long product_series;
|
||||
|
||||
private Integer standing_time;
|
||||
|
||||
private Integer material_qty;
|
||||
}
|
||||
|
||||
@@ -176,7 +176,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
//载具数量
|
||||
String vehicle_num = whereJson.getString("vehicle_num");
|
||||
//物料数量
|
||||
String material_num = whereJson.getString("material_num");
|
||||
String material_num = whereJson.getString("qty");
|
||||
|
||||
if (ObjectUtil.isEmpty(type)) throw new BadRequestException("类型不能为空");
|
||||
if (ObjectUtil.isEmpty(point_code)) throw new BadRequestException("点位不能为空");
|
||||
|
||||
@@ -74,6 +74,15 @@ public class WorkorderController {
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
@PutMapping("/executes")
|
||||
@Log("手持确认工单执行")
|
||||
@ApiOperation("手持确认工单执行")
|
||||
//@SaCheckPermission("produceshiftorder:edit")
|
||||
public ResponseEntity<Object> executes(@RequestBody JSONObject param){
|
||||
workordeService.executes(param);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
@PostMapping("/getDevice")
|
||||
@Log("根据登录用户设备下拉")
|
||||
@ApiOperation("根据登录用户设备下拉")
|
||||
|
||||
@@ -121,4 +121,10 @@ public interface WorkordeService {
|
||||
* @return
|
||||
*/
|
||||
JSONArray getDtl(JSONObject param);
|
||||
|
||||
/**
|
||||
* 工单执行
|
||||
* @param param
|
||||
*/
|
||||
void executes(JSONObject param);
|
||||
}
|
||||
|
||||
@@ -189,7 +189,7 @@ public class WorkorderServiceImpl implements WorkordeService {
|
||||
JSONObject json = wo.query("workorder_id = '" + param.getString("workorder_id") + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(json.getString("device_id"))) throw new BadRequestException("请先绑定设备");
|
||||
|
||||
JSONArray orderArr = wo.query("device_id = '" + param.getString("device_id") + "' and order_status = '02'").getResultJSONArray(0);
|
||||
JSONArray orderArr = wo.query("device_id = '" + param.getString("device_id") + "' and order_status = '3'").getResultJSONArray(0);
|
||||
if (ObjectUtil.isNotEmpty(orderArr)) throw new BadRequestException("当前设备正在生产中");
|
||||
|
||||
json.put("order_status", "2");
|
||||
@@ -439,4 +439,24 @@ public class WorkorderServiceImpl implements WorkordeService {
|
||||
return resultJSONArray;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void executes(JSONObject param) {
|
||||
Long currentUserId = SecurityUtils.getCurrentUserId();
|
||||
String nickName = SecurityUtils.getCurrentNickName();
|
||||
String now = DateUtil.now();
|
||||
|
||||
WQLObject wo = WQLObject.getWQLObject("PDM_BD_WorkOrder");
|
||||
JSONObject json = wo.query("workorder_id = '" + param.getString("workorder_id") + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(json.getString("device_id"))) throw new BadRequestException("请先绑定设备");
|
||||
|
||||
JSONArray orderArr = wo.query("device_id = '" + json.getString("device_id") + "' and order_status = '3'").getResultJSONArray(0);
|
||||
if (ObjectUtil.isNotEmpty(orderArr)) throw new BadRequestException("当前设备正在生产中");
|
||||
|
||||
json.put("order_status", "3");
|
||||
json.put("update_optid", currentUserId);
|
||||
json.put("update_optname", nickName);
|
||||
json.put("update_time", now);
|
||||
wo.update(json);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -100,6 +100,7 @@ public class YqxSendMaterialTask extends AbstractAcsTask {
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void findNextPoint() {
|
||||
String task_status = TaskStatusEnum.SURE_START.getCode();
|
||||
WQLObject taskTab = WQLObject.getWQLObject("SCH_BASE_Task");
|
||||
@@ -141,8 +142,6 @@ public class YqxSendMaterialTask extends AbstractAcsTask {
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public String createTask(JSONObject whereJson) {
|
||||
String point_code1 = whereJson.getString("point_code1");
|
||||
String vehicle_type = whereJson.getString("vehicle_type");
|
||||
String vehicle_code = whereJson.getString("vehicle_code");
|
||||
String qty = whereJson.getString("qty");
|
||||
|
||||
//生产工单表【PDM_BD_WorkOrder】
|
||||
@@ -169,10 +168,9 @@ public class YqxSendMaterialTask extends AbstractAcsTask {
|
||||
.task_name("油漆线满料")
|
||||
.task_status(TaskStatusEnum.SURE_START.getCode())
|
||||
.point_code1(point_code1)
|
||||
.vehicle_code(vehicle_code)
|
||||
.material_info_id(workOrderObj.getLong("workorder_id"))
|
||||
.material_id(workOrderObj.getLong("material_id"))
|
||||
.vehicle_type(vehicle_type)
|
||||
.vehicle_type(workOrderObj.getString("vehicle_type"))
|
||||
.handle_class(THIS_CLASS)
|
||||
.material_qty(qty)
|
||||
.create_time(DateUtil.now())
|
||||
|
||||
Binary file not shown.
Reference in New Issue
Block a user