代码更新
This commit is contained in:
BIN
lms/nladmin-system/doc/sch2.xls
Normal file
BIN
lms/nladmin-system/doc/sch2.xls
Normal file
Binary file not shown.
@@ -1,27 +0,0 @@
|
||||
package org.nl.wms.basedata.master.eum;
|
||||
|
||||
public enum BusinessCodeEnum {
|
||||
STOCK_IN(1,"10","入库"),
|
||||
STOCK_OUT(2,"20","出库"),
|
||||
QUALITY_INSPECTOR(3,"30","质检"),
|
||||
CHEMISTRY(4,"40","理化");
|
||||
|
||||
|
||||
private int index;
|
||||
private String name;
|
||||
private String code;
|
||||
|
||||
private BusinessCodeEnum(int index, String code, String name) {
|
||||
this.index = index;
|
||||
this.code = code;
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public String getCode() {
|
||||
return code;
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
package org.nl.wms.basedata.master.constant;
|
||||
package org.nl.wms.basedata.master.eum;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
|
||||
@@ -6,13 +6,7 @@ import com.alibaba.fastjson.JSONObject;
|
||||
* 获取物料操作类型
|
||||
*/
|
||||
public enum MaterOptTypeEnum {
|
||||
QBWL(1, "00", "全部物料", "('1')", ""),
|
||||
BCP(2, "01", "管件半成品", "('1528555443906023424')", ""),
|
||||
YCL(3, "02", "管件原材料", "('1503644349995552768')", ""),
|
||||
CP(4, "03", "关键成品", "('1528555444031852544')", "");
|
||||
|
||||
|
||||
|
||||
QBWL(1, "00", "全部物料", "('1')", "");
|
||||
//顺序号
|
||||
private int index;
|
||||
//编码
|
||||
@@ -1,28 +0,0 @@
|
||||
package org.nl.wms.basedata.master.eum;
|
||||
|
||||
public enum RecordStatusEnum {
|
||||
CREATE(1,"01","生成"),
|
||||
SET_TRAY(2,"02","组盘"),
|
||||
STOCK_IN(3,"03","入库"),
|
||||
STOCK_OUT(4,"04","出库"),
|
||||
STOCK_STATE_IN(5,"05","入立库");
|
||||
|
||||
|
||||
private int index;
|
||||
private String name;
|
||||
private String code;
|
||||
|
||||
private RecordStatusEnum(int index, String code, String name) {
|
||||
this.index = index;
|
||||
this.code = code;
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public String getCode() {
|
||||
return code;
|
||||
}
|
||||
}
|
||||
@@ -8,7 +8,7 @@ import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.modules.logging.annotation.Log;
|
||||
import org.nl.wms.basedata.master.constant.MaterOptTypeEnum;
|
||||
import org.nl.wms.basedata.master.eum.MaterOptTypeEnum;
|
||||
import org.nl.wms.basedata.master.service.MaterialbaseService;
|
||||
import org.nl.wms.basedata.master.service.dto.MaterialbaseDto;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
|
||||
@@ -17,7 +17,7 @@ import org.nl.modules.common.utils.SecurityUtils;
|
||||
import org.nl.modules.wql.WQL;
|
||||
import org.nl.modules.wql.core.bean.WQLObject;
|
||||
import org.nl.modules.wql.util.WqlUtil;
|
||||
import org.nl.wms.basedata.master.constant.MaterOptTypeEnum;
|
||||
import org.nl.wms.basedata.master.eum.MaterOptTypeEnum;
|
||||
import org.nl.wms.basedata.master.service.ClassstandardService;
|
||||
import org.nl.wms.basedata.master.service.MaterialbaseService;
|
||||
import org.nl.wms.basedata.master.service.dto.MaterialbaseDto;
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@@ -1,120 +0,0 @@
|
||||
|
||||
package org.nl.wms.mps.rest;
|
||||
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.modules.logging.annotation.Log;
|
||||
import org.nl.wms.mps.service.PersoncorrdeviceService;
|
||||
import org.nl.wms.mps.service.dto.PersoncorrdeviceDto;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author geng by
|
||||
* @date 2022-05-26
|
||||
**/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@Api(tags = "人员设备维护管理")
|
||||
@RequestMapping("/api/personcorrdevice")
|
||||
@Slf4j
|
||||
public class PersoncorrdeviceController {
|
||||
|
||||
private final PersoncorrdeviceService personcorrdeviceService;
|
||||
|
||||
@GetMapping
|
||||
@Log("查询人员设备维护")
|
||||
@ApiOperation("查询人员设备维护")
|
||||
//@SaCheckPermission("personcorrdevice:list")
|
||||
public ResponseEntity<Object> query(@RequestParam Map whereJson, Pageable page){
|
||||
return new ResponseEntity<>(personcorrdeviceService.queryAll(whereJson,page),HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping
|
||||
@Log("新增人员设备维护")
|
||||
@ApiOperation("新增人员设备维护")
|
||||
//@SaCheckPermission("personcorrdevice:add")
|
||||
public ResponseEntity<Object> create(@Validated @RequestBody PersoncorrdeviceDto dto){
|
||||
personcorrdeviceService.create(dto);
|
||||
return new ResponseEntity<>(HttpStatus.CREATED);
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
@Log("修改人员设备维护")
|
||||
@ApiOperation("修改人员设备维护")
|
||||
//@SaCheckPermission("personcorrdevice:edit")
|
||||
public ResponseEntity<Object> update(@Validated @RequestBody PersoncorrdeviceDto dto){
|
||||
personcorrdeviceService.update(dto);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
@Log("删除人员设备维护")
|
||||
@ApiOperation("删除人员设备维护")
|
||||
//@SaCheckPermission("personcorrdevice:del")
|
||||
@DeleteMapping
|
||||
public ResponseEntity<Object> delete(@RequestBody Long[] ids) {
|
||||
personcorrdeviceService.deleteAll(ids);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/addPersons")
|
||||
@Log("添加人员")
|
||||
@ApiOperation("添加人员")
|
||||
//@SaCheckPermission("teamcorrperson:list")
|
||||
public ResponseEntity<Object> addPersons(@RequestBody JSONObject param) {
|
||||
personcorrdeviceService.addPersons(param);
|
||||
return new ResponseEntity<>( HttpStatus.OK);
|
||||
}
|
||||
|
||||
@GetMapping("/getDeviceByPerson")
|
||||
@Log("查询设备")
|
||||
@ApiOperation("查询设备")
|
||||
//@SaCheckPermission("personcorrdevice:list")
|
||||
public ResponseEntity<Object> getDeviceByPerson(@RequestParam Map whereJson, Pageable page){
|
||||
return new ResponseEntity<>(personcorrdeviceService.getDeviceByPerson(whereJson,page),HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/getHeader")
|
||||
@Log("查询表头")
|
||||
@ApiOperation("查询表头")
|
||||
//@SaCheckPermission("teamcorrperson:list")
|
||||
public ResponseEntity<Object> getHeader(@RequestBody JSONObject param) {
|
||||
return new ResponseEntity<>( personcorrdeviceService.getHeader(param),HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/getDeviceIdByUserId")
|
||||
@Log("查询人员的设备")
|
||||
@ApiOperation("查询人员的设备")
|
||||
//@SaCheckPermission("teamcorrperson:list")
|
||||
public ResponseEntity<Object> getDeviceIdByUserId(@RequestBody JSONObject param) {
|
||||
return new ResponseEntity<>( personcorrdeviceService.getDeviceIdByUserId(param),HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/addDevices")
|
||||
@Log("添加人员的设备")
|
||||
@ApiOperation("添加人员的设备")
|
||||
//@SaCheckPermission("teamcorrperson:list")
|
||||
public ResponseEntity<Object> addDevices(@RequestBody JSONObject param) {
|
||||
personcorrdeviceService.addDevices(param);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@DeleteMapping("/deleteRow")
|
||||
@Log("删除人员的设备")
|
||||
@ApiOperation("删除人员的设备")
|
||||
//@SaCheckPermission("teamcorrperson:list")
|
||||
public ResponseEntity<Object> deleteRow(@RequestBody JSONObject param) {
|
||||
personcorrdeviceService.deleteRow(param);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,65 +0,0 @@
|
||||
|
||||
package org.nl.wms.mps.rest;
|
||||
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.modules.logging.annotation.Log;
|
||||
import org.nl.wms.mps.service.TeamcorrpersonService;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author geng by
|
||||
* @date 2022-05-26
|
||||
**/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@Api(tags = "班组人员维护管理")
|
||||
@RequestMapping("/api/teamcorrperson")
|
||||
@Slf4j
|
||||
public class TeamcorrpersonController {
|
||||
|
||||
private final TeamcorrpersonService teamcorrpersonService;
|
||||
|
||||
@GetMapping
|
||||
@Log("查询班组人员维护")
|
||||
@ApiOperation("查询班组人员维护")
|
||||
//@SaCheckPermission("teamcorrperson:list")
|
||||
public ResponseEntity<Object> query(@RequestParam Map whereJson, Pageable page) {
|
||||
return new ResponseEntity<>(teamcorrpersonService.queryAll(whereJson, page), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/getPersonIdByTeamId")
|
||||
@Log("根据班组查询人员id")
|
||||
@ApiOperation("根据班组查询人员id")
|
||||
//@SaCheckPermission("teamcorrperson:list")
|
||||
public ResponseEntity<Object> getPersonIdByTeamId(@RequestBody JSONObject param) {
|
||||
return new ResponseEntity<>(teamcorrpersonService.getPersonIdByTeamId(param), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/addPersons")
|
||||
@Log("添加班组人员关系")
|
||||
@ApiOperation("添加班组人员关系")
|
||||
//@SaCheckPermission("teamcorrperson:list")
|
||||
public ResponseEntity<Object> addPersons(@RequestBody JSONObject param) {
|
||||
teamcorrpersonService.addPersons(param);
|
||||
return new ResponseEntity<>( HttpStatus.OK);
|
||||
}
|
||||
|
||||
@Log("删除")
|
||||
@ApiOperation("删除")
|
||||
//@SaCheckPermission("workteam:del")
|
||||
@DeleteMapping
|
||||
public ResponseEntity<Object> delete(@RequestBody Long[] ids) {
|
||||
teamcorrpersonService.deleteAll(ids);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
@@ -1,85 +0,0 @@
|
||||
|
||||
package org.nl.wms.mps.rest;
|
||||
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.modules.logging.annotation.Log;
|
||||
import org.nl.wms.mps.service.WorkteamService;
|
||||
import org.nl.wms.mps.service.dto.WorkteamDto;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author geng by
|
||||
* @date 2022-05-25
|
||||
**/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@Api(tags = "班组管理")
|
||||
@RequestMapping("/api/workteam")
|
||||
@Slf4j
|
||||
public class WorkteamController {
|
||||
|
||||
private final WorkteamService workteamService;
|
||||
|
||||
@GetMapping
|
||||
@Log("查询班组")
|
||||
@ApiOperation("查询班组")
|
||||
//@SaCheckPermission("workteam:list")
|
||||
public ResponseEntity<Object> query(@RequestParam Map whereJson, Pageable page){
|
||||
return new ResponseEntity<>(workteamService.queryAll(whereJson,page),HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping
|
||||
@Log("新增班组")
|
||||
@ApiOperation("新增班组")
|
||||
//@SaCheckPermission("workteam:add")
|
||||
public ResponseEntity<Object> create(@Validated @RequestBody WorkteamDto dto){
|
||||
workteamService.create(dto);
|
||||
return new ResponseEntity<>(HttpStatus.CREATED);
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
@Log("修改班组")
|
||||
@ApiOperation("修改班组")
|
||||
//@SaCheckPermission("workteam:edit")
|
||||
public ResponseEntity<Object> update(@Validated @RequestBody WorkteamDto dto){
|
||||
workteamService.update(dto);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
@Log("删除班组")
|
||||
@ApiOperation("删除班组")
|
||||
//@SaCheckPermission("workteam:del")
|
||||
@DeleteMapping
|
||||
public ResponseEntity<Object> delete(@RequestBody Long[] ids) {
|
||||
workteamService.deleteAll(ids);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@GetMapping("/getClasssystem")
|
||||
@Log("查询班制下拉")
|
||||
@ApiOperation("查询班制下拉")
|
||||
//@SaCheckPermission("workteam:list")
|
||||
public ResponseEntity<Object> getClasssystem(){
|
||||
return new ResponseEntity<>(workteamService.getClasssystem(),HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PutMapping("/changeActive")
|
||||
@Log("修改状态")
|
||||
@ApiOperation("修改状态")
|
||||
public ResponseEntity<Object> update(@RequestBody JSONObject json) {
|
||||
workteamService.changeActive(json);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,84 +0,0 @@
|
||||
|
||||
package org.nl.wms.mps.service;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.nl.wms.mps.service.dto.PersoncorrdeviceDto;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @description 服务接口
|
||||
* @author geng by
|
||||
* @date 2022-05-26
|
||||
**/
|
||||
public interface PersoncorrdeviceService {
|
||||
|
||||
/**
|
||||
* 查询数据分页
|
||||
* @param whereJson 条件
|
||||
* @param page 分页参数
|
||||
* @return Map<String,Object>
|
||||
*/
|
||||
Map<String,Object> queryAll(Map whereJson, Pageable page);
|
||||
|
||||
/**
|
||||
* 查询所有数据不分页
|
||||
* @param whereJson 条件参数
|
||||
* @return List<PersoncorrdeviceDto>
|
||||
*/
|
||||
List<PersoncorrdeviceDto> queryAll(Map whereJson);
|
||||
|
||||
/**
|
||||
* 根据ID查询
|
||||
* @param team_person_device_id ID
|
||||
* @return Personcorrdevice
|
||||
*/
|
||||
PersoncorrdeviceDto findById(Long team_person_device_id);
|
||||
|
||||
/**
|
||||
* 根据编码查询
|
||||
* @param code code
|
||||
* @return Personcorrdevice
|
||||
*/
|
||||
PersoncorrdeviceDto findByCode(String code);
|
||||
|
||||
|
||||
/**
|
||||
* 创建
|
||||
* @param dto /
|
||||
*/
|
||||
void create(PersoncorrdeviceDto dto);
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
* @param dto /
|
||||
*/
|
||||
void update(PersoncorrdeviceDto dto);
|
||||
|
||||
/**
|
||||
* 多选删除
|
||||
* @param ids /
|
||||
*/
|
||||
void deleteAll(Long[] ids);
|
||||
|
||||
void addPersons(JSONObject param);
|
||||
|
||||
/**
|
||||
* 设备
|
||||
* @param whereJson 条件
|
||||
* @param page 分页参数
|
||||
* @return Map<String,Object>
|
||||
*/
|
||||
Map<String,Object> getDeviceByPerson(Map whereJson, Pageable page);
|
||||
|
||||
Map<String, Object> getHeader(JSONObject param);
|
||||
|
||||
JSONArray getDeviceIdByUserId(JSONObject param);
|
||||
|
||||
void addDevices(JSONObject param);
|
||||
|
||||
void deleteRow(JSONObject param);
|
||||
}
|
||||
@@ -1,34 +0,0 @@
|
||||
|
||||
package org.nl.wms.mps.service;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @description 服务接口
|
||||
* @author geng by
|
||||
* @date 2022-05-26
|
||||
**/
|
||||
public interface TeamcorrpersonService {
|
||||
|
||||
/**
|
||||
* 查询数据分页
|
||||
* @param whereJson 条件
|
||||
* @param page 分页参数
|
||||
* @return Map<String,Object>
|
||||
*/
|
||||
Map<String,Object> queryAll(Map whereJson, Pageable page);
|
||||
|
||||
JSONArray getPersonIdByTeamId(JSONObject param);
|
||||
|
||||
void addPersons(JSONObject param);
|
||||
|
||||
/**
|
||||
* 多选删除
|
||||
* @param ids /
|
||||
*/
|
||||
void deleteAll(Long[] ids);
|
||||
}
|
||||
@@ -1,74 +0,0 @@
|
||||
|
||||
package org.nl.wms.mps.service;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.nl.wms.mps.service.dto.WorkteamDto;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @description 服务接口
|
||||
* @author geng by
|
||||
* @date 2022-05-25
|
||||
**/
|
||||
public interface WorkteamService {
|
||||
|
||||
/**
|
||||
* 查询数据分页
|
||||
* @param whereJson 条件
|
||||
* @param page 分页参数
|
||||
* @return Map<String,Object>
|
||||
*/
|
||||
Map<String,Object> queryAll(Map whereJson, Pageable page);
|
||||
|
||||
/**
|
||||
* 查询所有数据不分页
|
||||
* @param whereJson 条件参数
|
||||
* @return List<WorkteamDto>
|
||||
*/
|
||||
List<WorkteamDto> queryAll(Map whereJson);
|
||||
|
||||
/**
|
||||
* 根据ID查询
|
||||
* @param team_id ID
|
||||
* @return Workteam
|
||||
*/
|
||||
WorkteamDto findById(Long team_id);
|
||||
|
||||
/**
|
||||
* 根据编码查询
|
||||
* @param code code
|
||||
* @return Workteam
|
||||
*/
|
||||
WorkteamDto findByCode(String code);
|
||||
|
||||
|
||||
/**
|
||||
* 创建
|
||||
* @param dto /
|
||||
*/
|
||||
void create(WorkteamDto dto);
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
* @param dto /
|
||||
*/
|
||||
void update(WorkteamDto dto);
|
||||
|
||||
/**
|
||||
* 多选删除
|
||||
* @param ids /
|
||||
*/
|
||||
void deleteAll(Long[] ids);
|
||||
|
||||
/**
|
||||
* 班制下拉
|
||||
* @return
|
||||
*/
|
||||
JSONArray getClasssystem();
|
||||
|
||||
void changeActive(JSONObject json);
|
||||
}
|
||||
@@ -1,27 +0,0 @@
|
||||
package org.nl.wms.mps.service.dto;
|
||||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @description /
|
||||
* @author geng by
|
||||
* @date 2022-05-26
|
||||
**/
|
||||
@Data
|
||||
public class PersoncorrdeviceDto implements Serializable {
|
||||
|
||||
/** 班组人员设备对应标识 */
|
||||
/** 防止精度丢失 */
|
||||
@JsonSerialize(using= ToStringSerializer.class)
|
||||
private Long team_person_device_id;
|
||||
|
||||
/** 操作工标识 */
|
||||
private Long jockey_id;
|
||||
|
||||
/** 设备标识 */
|
||||
private Long device_id;
|
||||
}
|
||||
@@ -1,27 +0,0 @@
|
||||
package org.nl.wms.mps.service.dto;
|
||||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @description /
|
||||
* @author geng by
|
||||
* @date 2022-05-26
|
||||
**/
|
||||
@Data
|
||||
public class TeamcorrpersonDto implements Serializable {
|
||||
|
||||
/** 班组人员对应标识 */
|
||||
/** 防止精度丢失 */
|
||||
@JsonSerialize(using= ToStringSerializer.class)
|
||||
private Long team_person_id;
|
||||
|
||||
/** 班组标识 */
|
||||
private Long team_id;
|
||||
|
||||
/** 操作工标识 */
|
||||
private Long jockey_id;
|
||||
}
|
||||
@@ -1,63 +0,0 @@
|
||||
package org.nl.wms.mps.service.dto;
|
||||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @description /
|
||||
* @author geng by
|
||||
* @date 2022-05-25
|
||||
**/
|
||||
@Data
|
||||
public class WorkteamDto implements Serializable {
|
||||
|
||||
/** 班组标识 */
|
||||
/** 防止精度丢失 */
|
||||
@JsonSerialize(using= ToStringSerializer.class)
|
||||
private Long team_id;
|
||||
|
||||
/** 班组编码 */
|
||||
private String team_code;
|
||||
|
||||
/** 班组名称 */
|
||||
private String team_name;
|
||||
|
||||
/** 班制标识 */
|
||||
private Long classsystem_id;
|
||||
|
||||
/** 备注 */
|
||||
private String remark;
|
||||
|
||||
/** 是否启用 */
|
||||
private String is_active;
|
||||
|
||||
/** 创建人 */
|
||||
private Long create_id;
|
||||
|
||||
/** 创建人姓名 */
|
||||
private String create_name;
|
||||
|
||||
/** 创建时间 */
|
||||
private String create_time;
|
||||
|
||||
/** 修改人 */
|
||||
private Long update_optid;
|
||||
|
||||
/** 修改人姓名 */
|
||||
private String update_optname;
|
||||
|
||||
/** 修改时间 */
|
||||
private String update_time;
|
||||
|
||||
/** 部门ID */
|
||||
private Long sysdeptid;
|
||||
|
||||
/** 公司ID */
|
||||
private Long syscompanyid;
|
||||
|
||||
/** 是否删除 */
|
||||
private String is_delete;
|
||||
}
|
||||
@@ -1,253 +0,0 @@
|
||||
|
||||
package org.nl.wms.mps.service.impl;
|
||||
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.map.MapUtil;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
|
||||
import org.nl.modules.common.exception.BadRequestException;
|
||||
import org.nl.modules.common.utils.SecurityUtils;
|
||||
import org.nl.modules.wql.WQL;
|
||||
import org.nl.modules.wql.core.bean.WQLObject;
|
||||
import org.nl.modules.wql.util.WqlUtil;
|
||||
import org.nl.wms.mps.service.PersoncorrdeviceService;
|
||||
import org.nl.wms.mps.service.dto.PersoncorrdeviceDto;
|
||||
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author geng by
|
||||
* @description 服务实现
|
||||
* @date 2022-05-26
|
||||
**/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
@Slf4j
|
||||
public class PersoncorrdeviceServiceImpl implements PersoncorrdeviceService {
|
||||
|
||||
@Override
|
||||
public Map<String, Object> queryAll(Map whereJson, Pageable page) {
|
||||
String search = MapUtil.getStr(whereJson, "search");
|
||||
JSONObject map = new JSONObject();
|
||||
map.put("flag", "1");
|
||||
if (!StrUtil.isEmpty(search)) {
|
||||
map.put("search", "%" + search + "%");
|
||||
}
|
||||
JSONObject json = WQL.getWO("MPS_Personcorrdevice001").addParamMap(map).pageQuery(WqlUtil.getHttpContext(page), "view_person.jockey_id");
|
||||
return json;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<PersoncorrdeviceDto> queryAll(Map whereJson) {
|
||||
WQLObject wo = WQLObject.getWQLObject("pdm_bi_personcorrdevice");
|
||||
JSONArray arr = wo.query().getResultJSONArray(0);
|
||||
if (ObjectUtil.isNotEmpty(arr)) return arr.toJavaList(PersoncorrdeviceDto.class);
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PersoncorrdeviceDto findById(Long team_person_device_id) {
|
||||
WQLObject wo = WQLObject.getWQLObject("pdm_bi_personcorrdevice");
|
||||
JSONObject json = wo.query("team_person_device_id = '" + team_person_device_id + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isNotEmpty(json)) {
|
||||
return json.toJavaObject(PersoncorrdeviceDto.class);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PersoncorrdeviceDto findByCode(String code) {
|
||||
WQLObject wo = WQLObject.getWQLObject("pdm_bi_personcorrdevice");
|
||||
JSONObject json = wo.query("code ='" + code + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isNotEmpty(json)) {
|
||||
return json.toJavaObject(PersoncorrdeviceDto.class);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void create(PersoncorrdeviceDto dto) {
|
||||
Long currentUserId = SecurityUtils.getCurrentUserId();
|
||||
String nickName = SecurityUtils.getCurrentNickName();
|
||||
String now = DateUtil.now();
|
||||
|
||||
dto.setTeam_person_device_id(IdUtil.getSnowflake(1, 1).nextId());
|
||||
|
||||
WQLObject wo = WQLObject.getWQLObject("pdm_bi_personcorrdevice");
|
||||
JSONObject json = JSONObject.parseObject(JSON.toJSONString(dto));
|
||||
wo.insert(json);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void update(PersoncorrdeviceDto dto) {
|
||||
PersoncorrdeviceDto entity = this.findById(dto.getTeam_person_device_id());
|
||||
if (entity == null) throw new BadRequestException("被删除或无权限,操作失败!");
|
||||
|
||||
Long currentUserId = SecurityUtils.getCurrentUserId();
|
||||
String nickName = SecurityUtils.getCurrentNickName();
|
||||
|
||||
String now = DateUtil.now();
|
||||
WQLObject wo = WQLObject.getWQLObject("pdm_bi_personcorrdevice");
|
||||
JSONObject json = JSONObject.parseObject(JSON.toJSONString(dto));
|
||||
wo.update(json);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void deleteAll(Long[] ids) {
|
||||
WQLObject wo = WQLObject.getWQLObject("pdm_bi_personcorrdevice");
|
||||
for (Long jockey_id : ids) {
|
||||
wo.delete("jockey_id = '" + jockey_id + "'");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void addPersons(JSONObject param) {
|
||||
final JSONArray persons = param.getJSONArray("persons");
|
||||
WQLObject wo = WQLObject.getWQLObject("pdm_bi_personcorrdevice");
|
||||
for (int i = 0; i < persons.size(); i++) {
|
||||
final JSONObject jsonObject = persons.getJSONObject(i);
|
||||
final String id = jsonObject.getString("id");
|
||||
final JSONArray jsonArray = wo.query("jockey_id = '" + id + "'").getResultJSONArray(0);
|
||||
if (ObjectUtil.isEmpty(jsonArray)) {
|
||||
JSONObject map = new JSONObject();
|
||||
map.put("team_person_device_id", IdUtil.getSnowflake(1, 1).nextId());
|
||||
map.put("jockey_id", id);
|
||||
wo.insert(map);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> getDeviceByPerson(Map whereJson, Pageable page) {
|
||||
String user_id = MapUtil.getStr(whereJson, "user_id");
|
||||
JSONObject map2 = new JSONObject();
|
||||
map2.put("flag", "3");
|
||||
map2.put("user_id", user_id);
|
||||
//根据人员获取设备信息
|
||||
JSONObject json = WQL.getWO("MPS_Personcorrdevice001").addParamMap(map2).pageQuery(WqlUtil.getHttpContext(page), "device.device_code");
|
||||
JSONArray jsonArray = json.getJSONArray("content");
|
||||
JSONArray newContent = new JSONArray();
|
||||
for (int i = 0; i < jsonArray.size(); i++) {
|
||||
JSONObject jsonObject = jsonArray.getJSONObject(i);
|
||||
JSONObject map = new JSONObject();
|
||||
String device_id = jsonObject.getString("device_id");
|
||||
map.put("flag", "4");
|
||||
map.put("device_id", device_id);
|
||||
//获取设备所拥有的项点信息
|
||||
JSONArray itemArray = WQL.getWO("MPS_Personcorrdevice001").addParamMap(map).process().getResultJSONArray(0);
|
||||
JSONObject newMap = new JSONObject();
|
||||
newMap.put("team_person_device_id", jsonObject.getString("team_person_device_id"));
|
||||
newMap.put("device_id", jsonObject.getString("device_id"));
|
||||
newMap.put("device_code", jsonObject.getString("device_code"));
|
||||
newMap.put("device_name", jsonObject.getString("device_name"));
|
||||
newMap.put("workprocedure_code", jsonObject.getString("workprocedure_code"));
|
||||
newMap.put("workprocedure_name", jsonObject.getString("workprocedure_name"));
|
||||
//循环每个设备的项点信息,将项点所对应的键设为项点编码,对应动态表格的prop
|
||||
for (int j = 0; j < itemArray.size(); j++) {
|
||||
JSONObject itemObject = itemArray.getJSONObject(j);
|
||||
newMap.put(itemObject.getString("item_code"), itemObject.getString("item_value"));
|
||||
}
|
||||
newContent.add(newMap);
|
||||
}
|
||||
json.put("content", newContent);
|
||||
return json;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> getHeader(JSONObject param) {
|
||||
//动态获取设备类型下对应的项点信息
|
||||
String user_id = param.getString("user_id");
|
||||
JSONObject map = new JSONObject();
|
||||
map.put("flag", "2");
|
||||
map.put("user_id", user_id);
|
||||
final JSONArray jsonArray = WQL.getWO("MPS_Personcorrdevice001").addParamMap(map).process().getResultJSONArray(0);
|
||||
JSONArray newArray = new JSONArray();
|
||||
for (int i = 0; i < jsonArray.size(); i++) {
|
||||
JSONObject jsonObject = jsonArray.getJSONObject(i);
|
||||
String item_name = jsonObject.getString("item_name");
|
||||
JSONObject json = new JSONObject();
|
||||
json.put("label", item_name);
|
||||
//将表格prop设置为项点编码
|
||||
json.put("prop", jsonObject.getString("item_code"));
|
||||
json.put("show", true);
|
||||
if (item_name.length() >= 6) {
|
||||
json.put("width", "150");
|
||||
}
|
||||
newArray.add(json);
|
||||
}
|
||||
JSONObject resultMap = new JSONObject();
|
||||
resultMap.put("newArray", newArray);
|
||||
return resultMap;
|
||||
}
|
||||
|
||||
@Override
|
||||
public JSONArray getDeviceIdByUserId(JSONObject param) {
|
||||
WQLObject wo = WQLObject.getWQLObject("pdm_bi_personcorrdevice");
|
||||
final JSONArray resultJSONArray = wo.query("jockey_id = '" + param.getString("user_id") + "'").getResultJSONArray(0);
|
||||
return resultJSONArray;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void addDevices(JSONObject param) {
|
||||
WQLObject wo = WQLObject.getWQLObject("pdm_bi_personcorrdevice");
|
||||
final String user_id = param.getString("user_id");
|
||||
final JSONArray devices = param.getJSONArray("devices");
|
||||
final JSONObject is_exists = wo.query("jockey_id = '" + user_id + "' and (device_id is null or device_id = '" + "" + "')").uniqueResult(0);
|
||||
if (ObjectUtil.isNotEmpty(is_exists)) {
|
||||
wo.delete("jockey_id = '" + user_id + "'");
|
||||
}
|
||||
for (int i = 0; i < devices.size(); i++) {
|
||||
final JSONObject jsonObject = devices.getJSONObject(i);
|
||||
final String device_id = jsonObject.getString("device_id");
|
||||
final JSONObject object = wo.query("jockey_id = '" + user_id + "' and device_id = '" + device_id + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(object)) {
|
||||
JSONObject map = new JSONObject();
|
||||
map.put("team_person_device_id", IdUtil.getSnowflake(1, 1).nextId());
|
||||
map.put("jockey_id", user_id);
|
||||
map.put("device_id", device_id);
|
||||
wo.insert(map);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void deleteRow(JSONObject param) {
|
||||
JSONArray rows = param.getJSONArray("rows");
|
||||
final String user_id = param.getString("user_id");
|
||||
WQLObject wo = WQLObject.getWQLObject("pdm_bi_personcorrdevice");
|
||||
for (int i = 0; i < rows.size(); i++) {
|
||||
final JSONObject jsonObject = rows.getJSONObject(i);
|
||||
final String team_person_device_id = jsonObject.getString("team_person_device_id");
|
||||
final JSONArray resultJSONArray = wo.query("team_person_device_id = '" + team_person_device_id + "'").getResultJSONArray(0);
|
||||
wo.delete("team_person_device_id = '" + team_person_device_id + "'");
|
||||
}
|
||||
final JSONArray resultJSONArray = wo.query("jockey_id = '" + user_id + "'").getResultJSONArray(0);
|
||||
if (ObjectUtil.isEmpty(resultJSONArray)){
|
||||
JSONObject map = new JSONObject();
|
||||
map.put("team_person_device_id",IdUtil.getSnowflake(1, 1).nextId());
|
||||
map.put("jockey_id",user_id);
|
||||
wo.insert(map);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,77 +0,0 @@
|
||||
|
||||
package org.nl.wms.mps.service.impl;
|
||||
|
||||
|
||||
import cn.hutool.core.map.MapUtil;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.modules.wql.WQL;
|
||||
import org.nl.modules.wql.core.bean.WQLObject;
|
||||
import org.nl.modules.wql.util.WqlUtil;
|
||||
import org.nl.wms.mps.service.TeamcorrpersonService;
|
||||
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author geng by
|
||||
* @description 服务实现
|
||||
* @date 2022-05-26
|
||||
**/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
@Slf4j
|
||||
public class TeamcorrpersonServiceImpl implements TeamcorrpersonService {
|
||||
|
||||
@Override
|
||||
public Map<String, Object> queryAll(Map whereJson, Pageable page) {
|
||||
String team_id = MapUtil.getStr(whereJson, "team_id");
|
||||
JSONObject map = new JSONObject();
|
||||
map.put("flag", "1");
|
||||
map.put("team_id", team_id);
|
||||
JSONObject json = WQL.getWO("MPS_Teamcorrperson001").addParamMap(map).pageQuery(WqlUtil.getHttpContext(page), "teamPerson.jockey_id");
|
||||
return json;
|
||||
}
|
||||
|
||||
@Override
|
||||
public JSONArray getPersonIdByTeamId(JSONObject param) {
|
||||
WQLObject wo = WQLObject.getWQLObject("PDM_BI_TeamCorrPerson");
|
||||
final JSONArray resultJSONArray = wo.query("team_id = '" + param.getString("team_id") + "'").getResultJSONArray(0);
|
||||
return resultJSONArray;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addPersons(JSONObject param) {
|
||||
WQLObject wo = WQLObject.getWQLObject("PDM_BI_TeamCorrPerson");
|
||||
final String team_id = param.getString("team_id");
|
||||
final JSONArray persons = param.getJSONArray("persons");
|
||||
for (int i = 0; i < persons.size(); i++) {
|
||||
final JSONObject jsonObject = persons.getJSONObject(i);
|
||||
final String id = jsonObject.getString("id");
|
||||
final JSONObject object = wo.query("team_id = '" + team_id + "' and jockey_id = '" + id + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(object)) {
|
||||
JSONObject map = new JSONObject();
|
||||
map.put("team_person_id", IdUtil.getSnowflake(1, 1).nextId());
|
||||
map.put("team_id", team_id);
|
||||
map.put("jockey_id", id);
|
||||
wo.insert(map);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void deleteAll(Long[] ids) {
|
||||
WQLObject wo = WQLObject.getWQLObject("PDM_BI_TeamCorrPerson");
|
||||
for (Long team_person_id : ids) {
|
||||
wo.delete("team_person_id = '" + team_person_id + "'");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,176 +0,0 @@
|
||||
|
||||
package org.nl.wms.mps.service.impl;
|
||||
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.map.MapUtil;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.modules.common.exception.BadRequestException;
|
||||
import org.nl.modules.common.utils.SecurityUtils;
|
||||
import org.nl.modules.common.utils.dto.CurrentUser;
|
||||
import org.nl.modules.wql.core.bean.ResultBean;
|
||||
import org.nl.modules.wql.core.bean.WQLObject;
|
||||
import org.nl.modules.wql.util.WqlUtil;
|
||||
import org.nl.wms.mps.service.WorkteamService;
|
||||
import org.nl.wms.mps.service.dto.WorkteamDto;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author geng by
|
||||
* @description 服务实现
|
||||
* @date 2022-05-25
|
||||
**/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
@Slf4j
|
||||
public class WorkteamServiceImpl implements WorkteamService {
|
||||
|
||||
@Override
|
||||
public Map<String, Object> queryAll(Map whereJson, Pageable page) {
|
||||
WQLObject wo = WQLObject.getWQLObject("pdm_bi_workteam");
|
||||
final String search = MapUtil.getStr(whereJson, "search");
|
||||
String where = "";
|
||||
if (!StrUtil.isEmpty(search)) {
|
||||
where = " AND (team_code like '%" + search + "%' OR team_name like '%" + search + "%' ) ";
|
||||
}
|
||||
ResultBean rb = wo.pagequery(WqlUtil.getHttpContext(page), "is_delete = '0'" + where, "update_time desc");
|
||||
final JSONObject json = rb.pageResult();
|
||||
return json;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<WorkteamDto> queryAll(Map whereJson) {
|
||||
WQLObject wo = WQLObject.getWQLObject("pdm_bi_workteam");
|
||||
JSONArray arr = wo.query().getResultJSONArray(0);
|
||||
if (ObjectUtil.isNotEmpty(arr)) return arr.toJavaList(WorkteamDto.class);
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public WorkteamDto findById(Long team_id) {
|
||||
WQLObject wo = WQLObject.getWQLObject("pdm_bi_workteam");
|
||||
JSONObject json = wo.query("team_id = '" + team_id + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isNotEmpty(json)) {
|
||||
return json.toJavaObject(WorkteamDto.class);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public WorkteamDto findByCode(String code) {
|
||||
WQLObject wo = WQLObject.getWQLObject("pdm_bi_workteam");
|
||||
JSONObject json = wo.query("team_code ='" + code + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isNotEmpty(json)) {
|
||||
return json.toJavaObject(WorkteamDto.class);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void create(WorkteamDto dto) {
|
||||
Long currentUserId = SecurityUtils.getCurrentUserId();
|
||||
String nickName = SecurityUtils.getCurrentNickName();
|
||||
String now = DateUtil.now();
|
||||
CurrentUser currentUser = SecurityUtils.getCurrentUser();
|
||||
Long deptId = currentUser.getUser().getDept().getId();
|
||||
|
||||
//编码唯一性校验
|
||||
String team_code = dto.getTeam_code();
|
||||
WorkteamDto byCode = this.findByCode(team_code);
|
||||
if (ObjectUtil.isNotEmpty(byCode)) throw new BadRequestException("编码已存在!");
|
||||
|
||||
dto.setTeam_id(IdUtil.getSnowflake(1, 1).nextId());
|
||||
dto.setCreate_id(currentUserId);
|
||||
dto.setCreate_name(nickName);
|
||||
dto.setUpdate_optid(currentUserId);
|
||||
dto.setUpdate_optname(nickName);
|
||||
dto.setUpdate_time(now);
|
||||
dto.setCreate_time(now);
|
||||
dto.setSyscompanyid(deptId);
|
||||
dto.setSysdeptid(deptId);
|
||||
|
||||
WQLObject wo = WQLObject.getWQLObject("pdm_bi_workteam");
|
||||
JSONObject json = JSONObject.parseObject(JSON.toJSONString(dto));
|
||||
wo.insert(json);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void update(WorkteamDto dto) {
|
||||
WorkteamDto entity = this.findById(dto.getTeam_id());
|
||||
if (entity == null) throw new BadRequestException("被删除或无权限,操作失败!");
|
||||
|
||||
//编码唯一性校验
|
||||
WQLObject wo = WQLObject.getWQLObject("pdm_bi_workteam");
|
||||
String where = "is_delete = '0' and team_code = '" + dto.getTeam_code() + "' and team_id != '" + dto.getTeam_id() + "'";
|
||||
|
||||
JSONObject jsonObject = wo.query(where).uniqueResult(0);
|
||||
if (ObjectUtil.isNotEmpty(jsonObject)) {
|
||||
throw new BadRequestException("编码已存在!");
|
||||
}
|
||||
|
||||
Long currentUserId = SecurityUtils.getCurrentUserId();
|
||||
String nickName = SecurityUtils.getCurrentNickName();
|
||||
|
||||
String now = DateUtil.now();
|
||||
dto.setUpdate_time(now);
|
||||
dto.setUpdate_optid(currentUserId);
|
||||
dto.setUpdate_optname(nickName);
|
||||
|
||||
|
||||
JSONObject json = JSONObject.parseObject(JSON.toJSONString(dto));
|
||||
wo.update(json);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void deleteAll(Long[] ids) {
|
||||
WQLObject wo = WQLObject.getWQLObject("pdm_bi_workteam");
|
||||
WQLObject wo_person = WQLObject.getWQLObject("PDM_BI_TeamCorrPerson");
|
||||
for (Long team_id : ids) {
|
||||
wo.delete("team_id = '" + team_id + "'");
|
||||
wo_person.delete("team_id = '" + team_id + "'");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public JSONArray getClasssystem() {
|
||||
// WQLObject wo = WQLObject.getWQLObject("PDM_BI_ClassSystem");
|
||||
// final JSONArray resultJSONArray = wo.query("is_delete = '0'").getResultJSONArray(0);
|
||||
//return resultJSONArray;
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void changeActive(JSONObject json) {
|
||||
|
||||
Long currentUserId = SecurityUtils.getCurrentUserId();
|
||||
String nickName = SecurityUtils.getCurrentNickName();
|
||||
String now = DateUtil.now();
|
||||
|
||||
String is_active = "1";
|
||||
if (StrUtil.equals("1", json.getString("is_active"))) {
|
||||
is_active = "0";
|
||||
}
|
||||
json.put("is_active", is_active);
|
||||
json.put("update_optid", currentUserId);
|
||||
json.put("update_optname", nickName);
|
||||
json.put("update_time", now);
|
||||
WQLObject.getWQLObject("PDM_BI_WorkTeam").update(json);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,130 +0,0 @@
|
||||
[交易说明]
|
||||
交易名: 人员设备维护查询
|
||||
所属模块:
|
||||
功能简述:
|
||||
版权所有:
|
||||
表引用:
|
||||
版本经历:
|
||||
|
||||
[数据库]
|
||||
--指定数据库,为空采用默认值,默认为db.properties中列出的第一个库
|
||||
|
||||
[IO定义]
|
||||
#################################################
|
||||
## 表字段对应输入参数
|
||||
#################################################
|
||||
输入.flag TYPEAS s_string
|
||||
输入.search TYPEAS s_string
|
||||
输入.user_id TYPEAS s_string
|
||||
输入.device_id TYPEAS s_string
|
||||
|
||||
|
||||
[临时表]
|
||||
--这边列出来的临时表就会在运行期动态创建
|
||||
|
||||
[临时变量]
|
||||
--所有中间过程变量均可在此处定义
|
||||
|
||||
[业务过程]
|
||||
|
||||
##########################################
|
||||
# 1、输入输出检查 #
|
||||
##########################################
|
||||
|
||||
|
||||
##########################################
|
||||
# 2、主过程前处理 #
|
||||
##########################################
|
||||
|
||||
|
||||
##########################################
|
||||
# 3、业务主过程 #
|
||||
##########################################
|
||||
|
||||
IF 输入.flag = "1"
|
||||
PAGEQUERY
|
||||
SELECT
|
||||
view_person.*
|
||||
FROM
|
||||
(
|
||||
SELECT
|
||||
personDevice.*,
|
||||
user.*
|
||||
FROM
|
||||
PDM_BI_PersonCorrDevice personDevice
|
||||
LEFT JOIN sys_user user ON personDevice.jockey_id = user.user_id
|
||||
WHERE
|
||||
user.enabled = '1'
|
||||
GROUP BY
|
||||
personDevice.jockey_id
|
||||
) view_person
|
||||
where
|
||||
1 = 1
|
||||
OPTION 输入.search <> ""
|
||||
(view_person.username like 输入.search or
|
||||
view_person.nick_name like 输入.search or
|
||||
view_person.phone like 输入.search)
|
||||
ENDOPTION
|
||||
ENDSELECT
|
||||
ENDPAGEQUERY
|
||||
ENDIF
|
||||
|
||||
IF 输入.flag = "2"
|
||||
QUERY
|
||||
SELECT
|
||||
personDevice.* ,
|
||||
device.device_code,
|
||||
device.device_name,
|
||||
item.item_code,
|
||||
item.item_name
|
||||
FROM
|
||||
PDM_BI_PersonCorrDevice personDevice
|
||||
LEFT JOIN sys_user user ON personDevice.jockey_id = user.user_id
|
||||
LEFT JOIN PDM_BI_Device device ON personDevice.device_id = device.device_id
|
||||
left join PDM_BI_DeviceItemValue deviceValue on deviceValue.device_id = device.device_id
|
||||
left join PDM_BI_DeviceItem item on item.item_id = deviceValue.item_id
|
||||
where
|
||||
personDevice.jockey_id = 输入.user_id
|
||||
GROUP BY
|
||||
item.item_code
|
||||
ENDSELECT
|
||||
ENDQUERY
|
||||
ENDIF
|
||||
|
||||
IF 输入.flag = "3"
|
||||
PAGEQUERY
|
||||
SELECT
|
||||
personDevice.*,
|
||||
device.device_code,
|
||||
device.device_name,
|
||||
work.workprocedure_code,
|
||||
work.workprocedure_name
|
||||
FROM
|
||||
PDM_BI_PersonCorrDevice personDevice
|
||||
left join PDM_BI_Device device on device.device_id = personDevice.device_id
|
||||
left join PDM_BI_WorkProcedure work on device.workprocedure_id = work.workprocedure_id
|
||||
where
|
||||
personDevice.jockey_id = 输入.user_id and (personDevice.device_id is not null or personDevice.device_id != "" )
|
||||
ENDSELECT
|
||||
ENDPAGEQUERY
|
||||
ENDIF
|
||||
|
||||
IF 输入.flag = "4"
|
||||
QUERY
|
||||
SELECT
|
||||
deviceItemValue.device_id,
|
||||
deviceItemValue.item_id,
|
||||
deviceItemValue.item_value,
|
||||
item.item_code
|
||||
FROM
|
||||
PDM_BI_DeviceItemValue deviceItemValue
|
||||
LEFT JOIN PDM_BI_Device device ON deviceItemValue.device_id = device.device_id
|
||||
LEFT JOIN PDM_BI_DeviceItem item ON deviceItemValue.item_id = item.item_id
|
||||
where
|
||||
deviceItemValue.device_id = 输入.device_id
|
||||
ENDSELECT
|
||||
ENDQUERY
|
||||
ENDIF
|
||||
|
||||
|
||||
|
||||
@@ -1,58 +0,0 @@
|
||||
[交易说明]
|
||||
交易名: 班组人员维护查询
|
||||
所属模块:
|
||||
功能简述:
|
||||
版权所有:
|
||||
表引用:
|
||||
版本经历:
|
||||
|
||||
[数据库]
|
||||
--指定数据库,为空采用默认值,默认为db.properties中列出的第一个库
|
||||
|
||||
[IO定义]
|
||||
#################################################
|
||||
## 表字段对应输入参数
|
||||
#################################################
|
||||
输入.flag TYPEAS s_string
|
||||
输入.team_id TYPEAS s_string
|
||||
|
||||
|
||||
[临时表]
|
||||
--这边列出来的临时表就会在运行期动态创建
|
||||
|
||||
[临时变量]
|
||||
--所有中间过程变量均可在此处定义
|
||||
|
||||
[业务过程]
|
||||
|
||||
##########################################
|
||||
# 1、输入输出检查 #
|
||||
##########################################
|
||||
|
||||
|
||||
##########################################
|
||||
# 2、主过程前处理 #
|
||||
##########################################
|
||||
|
||||
|
||||
##########################################
|
||||
# 3、业务主过程 #
|
||||
##########################################
|
||||
|
||||
IF 输入.flag = "1"
|
||||
PAGEQUERY
|
||||
SELECT
|
||||
teamPerson.*,
|
||||
user.*
|
||||
FROM
|
||||
PDM_BI_TeamCorrPerson teamPerson
|
||||
LEFT JOIN PDM_BI_WorkTeam team ON teamPerson.team_id = team.team_id
|
||||
LEFT JOIN sys_user user ON teamPerson.jockey_id = user.user_id
|
||||
WHERE
|
||||
teamPerson.team_id = 输入.team_id
|
||||
ENDSELECT
|
||||
ENDPAGEQUERY
|
||||
ENDIF
|
||||
|
||||
|
||||
|
||||
@@ -1,68 +0,0 @@
|
||||
|
||||
package org.nl.wms.pdm.rest;
|
||||
|
||||
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.modules.logging.annotation.Log;
|
||||
import org.nl.wms.pdm.service.DeviceitemService;
|
||||
import org.nl.wms.pdm.service.dto.DeviceitemDto;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author geng by
|
||||
* @date 2022-05-25
|
||||
**/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@Api(tags = "生产设备扩展项管理")
|
||||
@RequestMapping("/api/deviceitem")
|
||||
@Slf4j
|
||||
public class DeviceitemController {
|
||||
|
||||
private final DeviceitemService deviceitemService;
|
||||
|
||||
@GetMapping
|
||||
@Log("查询生产设备扩展项")
|
||||
@ApiOperation("查询生产设备扩展项")
|
||||
//@SaCheckPermission("deviceitem:list")
|
||||
public ResponseEntity<Object> query(@RequestParam Map whereJson, Pageable page){
|
||||
return new ResponseEntity<>(deviceitemService.queryAll(whereJson,page),HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping
|
||||
@Log("新增生产设备扩展项")
|
||||
@ApiOperation("新增生产设备扩展项")
|
||||
//@SaCheckPermission("deviceitem:add")
|
||||
public ResponseEntity<Object> create(@Validated @RequestBody DeviceitemDto dto){
|
||||
deviceitemService.create(dto);
|
||||
return new ResponseEntity<>(HttpStatus.CREATED);
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
@Log("修改生产设备扩展项")
|
||||
@ApiOperation("修改生产设备扩展项")
|
||||
//@SaCheckPermission("deviceitem:edit")
|
||||
public ResponseEntity<Object> update(@Validated @RequestBody DeviceitemDto dto){
|
||||
deviceitemService.update(dto);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
@Log("删除生产设备扩展项")
|
||||
@ApiOperation("删除生产设备扩展项")
|
||||
//@SaCheckPermission("deviceitem:del")
|
||||
@DeleteMapping
|
||||
public ResponseEntity<Object> delete(@RequestBody Long[] ids) {
|
||||
deviceitemService.deleteAll(ids);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
package org.nl.wms.mps.rest;
|
||||
package org.nl.wms.pdm.rest;
|
||||
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
@@ -7,8 +7,8 @@ import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.modules.logging.annotation.Log;
|
||||
import org.nl.wms.mps.service.ProduceshiftorderService;
|
||||
import org.nl.wms.mps.service.dto.ProduceshiftorderDto;
|
||||
import org.nl.wms.pdm.service.ProduceshiftorderService;
|
||||
import org.nl.wms.pdm.service.dto.ProduceshiftorderDto;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
@@ -1,65 +0,0 @@
|
||||
|
||||
package org.nl.wms.pdm.service;
|
||||
|
||||
import org.nl.wms.pdm.service.dto.DeviceitemDto;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @description 服务接口
|
||||
* @author geng by
|
||||
* @date 2022-05-25
|
||||
**/
|
||||
public interface DeviceitemService {
|
||||
|
||||
/**
|
||||
* 查询数据分页
|
||||
* @param whereJson 条件
|
||||
* @param page 分页参数
|
||||
* @return Map<String,Object>
|
||||
*/
|
||||
Map<String,Object> queryAll(Map whereJson, Pageable page);
|
||||
|
||||
/**
|
||||
* 查询所有数据不分页
|
||||
* @param whereJson 条件参数
|
||||
* @return List<DeviceitemDto>
|
||||
*/
|
||||
List<DeviceitemDto> queryAll(Map whereJson);
|
||||
|
||||
/**
|
||||
* 根据ID查询
|
||||
* @param item_id ID
|
||||
* @return Deviceitem
|
||||
*/
|
||||
DeviceitemDto findById(Long item_id);
|
||||
|
||||
/**
|
||||
* 根据编码查询
|
||||
* @param code code
|
||||
* @return Deviceitem
|
||||
*/
|
||||
DeviceitemDto findByCode(String code);
|
||||
|
||||
|
||||
/**
|
||||
* 创建
|
||||
* @param dto /
|
||||
*/
|
||||
void create(DeviceitemDto dto);
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
* @param dto /
|
||||
*/
|
||||
void update(DeviceitemDto dto);
|
||||
|
||||
/**
|
||||
* 多选删除
|
||||
* @param ids /
|
||||
*/
|
||||
void deleteAll(Long[] ids);
|
||||
|
||||
}
|
||||
@@ -1,8 +1,8 @@
|
||||
package org.nl.wms.mps.service;
|
||||
package org.nl.wms.pdm.service;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.nl.wms.mps.service.dto.ProduceshiftorderDto;
|
||||
import org.nl.wms.pdm.service.dto.ProduceshiftorderDto;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
|
||||
import java.util.List;
|
||||
@@ -1,63 +0,0 @@
|
||||
package org.nl.wms.pdm.service.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* @description /
|
||||
* @author geng by
|
||||
* @date 2022-06-02
|
||||
**/
|
||||
@Data
|
||||
public class BomDto implements Serializable {
|
||||
|
||||
/** BOM单标识 */
|
||||
private String bom_uuid;
|
||||
|
||||
/** BOM单编码 */
|
||||
private String bom_code;
|
||||
|
||||
/** BOM单名称 */
|
||||
private String bom_name;
|
||||
|
||||
/** 物料标识 */
|
||||
private String material_uuid;
|
||||
|
||||
/** 产品工艺路线标识 */
|
||||
private String processroute_uuid;
|
||||
|
||||
/** 成材率百分比 */
|
||||
private BigDecimal yield_rate;
|
||||
|
||||
/** 成品率百分比 */
|
||||
private BigDecimal endproduct_rate;
|
||||
|
||||
/** BOM单状态 */
|
||||
private String bom_status;
|
||||
|
||||
/** 明细数 */
|
||||
private BigDecimal detail_count;
|
||||
|
||||
/** 备注 */
|
||||
private String remark;
|
||||
|
||||
/** 创建人 */
|
||||
private Long create_id;
|
||||
|
||||
/** 创建人 */
|
||||
private String create_name;
|
||||
|
||||
/** 创建时间 */
|
||||
private String create_time;
|
||||
|
||||
/** 修改人 */
|
||||
private Long update_optid;
|
||||
|
||||
/** 修改人 */
|
||||
private String update_optname;
|
||||
|
||||
/** 修改时间 */
|
||||
private String update_time;
|
||||
}
|
||||
@@ -1,54 +0,0 @@
|
||||
package org.nl.wms.pdm.service.dto;
|
||||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* @author geng by
|
||||
* @description /
|
||||
* @date 2022-05-25
|
||||
**/
|
||||
@Data
|
||||
public class DeviceitemDto implements Serializable {
|
||||
|
||||
/** 项点标识 */
|
||||
/**
|
||||
* 防止精度丢失
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long item_id;
|
||||
|
||||
/**
|
||||
* 项点编码
|
||||
*/
|
||||
private String item_code;
|
||||
|
||||
/**
|
||||
* 项点名称
|
||||
*/
|
||||
private String item_name;
|
||||
|
||||
/**
|
||||
* 默认值
|
||||
*/
|
||||
private String default_value;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 顺序
|
||||
*/
|
||||
private BigDecimal order_seq;
|
||||
|
||||
/**
|
||||
* 默认值类型
|
||||
*/
|
||||
private String data_type;
|
||||
}
|
||||
@@ -1,76 +0,0 @@
|
||||
package org.nl.wms.pdm.service.dto;
|
||||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* @description /
|
||||
* @author Lxy
|
||||
* @date 2022-03-21
|
||||
**/
|
||||
@Data
|
||||
public class ProcessrouteDto implements Serializable {
|
||||
|
||||
/** 工艺路线标识 */
|
||||
/** 防止精度丢失 */
|
||||
@JsonSerialize(using= ToStringSerializer.class)
|
||||
private Long processroute_id;
|
||||
|
||||
/** 工艺路线编码 */
|
||||
private String processroute_code;
|
||||
|
||||
/** 工艺路线名称 */
|
||||
private String processroute_name;
|
||||
|
||||
/** 状态 */
|
||||
private String processroute_status;
|
||||
|
||||
/** 明细数 */
|
||||
private BigDecimal detail_count;
|
||||
|
||||
/** 备注 */
|
||||
private String remark;
|
||||
|
||||
/** 创建人 */
|
||||
private Long create_id;
|
||||
|
||||
/** 创建人姓名 */
|
||||
private String create_name;
|
||||
|
||||
/** 创建时间 */
|
||||
private String create_time;
|
||||
|
||||
/** 修改人 */
|
||||
private Long update_optid;
|
||||
|
||||
/** 修改人姓名 */
|
||||
private String update_optname;
|
||||
|
||||
/** 修改时间 */
|
||||
private String update_time;
|
||||
|
||||
/** 审核人 */
|
||||
private Long audit_optid;
|
||||
|
||||
/** 审核人姓名 */
|
||||
private String audit_optname;
|
||||
|
||||
/** 审核时间 */
|
||||
private String audit_time;
|
||||
|
||||
/** 部门ID */
|
||||
private Long sysdeptid;
|
||||
|
||||
/** 公司ID */
|
||||
private Long syscompanyid;
|
||||
|
||||
/** 是否删除 */
|
||||
private String is_delete;
|
||||
|
||||
/** 外部标识 */
|
||||
private String ext_id;
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
package org.nl.wms.mps.service.dto;
|
||||
package org.nl.wms.pdm.service.dto;
|
||||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
@@ -155,5 +155,4 @@ public class ProduceshiftorderDto implements Serializable {
|
||||
private String is_canupdate_update;
|
||||
|
||||
private Long device_id;
|
||||
private Long sale_id;
|
||||
}
|
||||
@@ -1,78 +0,0 @@
|
||||
package org.nl.wms.pdm.service.dto;
|
||||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* @description /
|
||||
* @author zhouz
|
||||
* @date 2022-03-22
|
||||
**/
|
||||
@Data
|
||||
public class ProductprocessrouteDto implements Serializable {
|
||||
|
||||
/** 产品工艺路线标识 */
|
||||
/** 防止精度丢失 */
|
||||
@JsonSerialize(using= ToStringSerializer.class)
|
||||
private Long productprocess_id;
|
||||
|
||||
/** 物料标识 */
|
||||
private Long material_id;
|
||||
|
||||
/** 工艺路线标识 */
|
||||
/** 防止精度丢失 */
|
||||
@JsonSerialize(using= ToStringSerializer.class)
|
||||
private Long processroute_id;
|
||||
|
||||
/** 产品工艺路线状态 */
|
||||
private String productprocess_status;
|
||||
|
||||
/** 明细数 */
|
||||
private BigDecimal detail_count;
|
||||
|
||||
/** 备注 */
|
||||
private String remark;
|
||||
|
||||
/** 创建人 */
|
||||
private Long create_id;
|
||||
|
||||
/** 创建人姓名 */
|
||||
private String create_name;
|
||||
|
||||
/** 创建时间 */
|
||||
private String create_time;
|
||||
|
||||
/** 修改人 */
|
||||
private Long update_optid;
|
||||
|
||||
/** 修改人姓名 */
|
||||
private String update_optname;
|
||||
|
||||
/** 修改时间 */
|
||||
private String update_time;
|
||||
|
||||
/** 审核人 */
|
||||
private Long audit_optid;
|
||||
|
||||
/** 审核人姓名 */
|
||||
private String audit_optname;
|
||||
|
||||
/** 审核时间 */
|
||||
private String audit_time;
|
||||
|
||||
/** 部门ID */
|
||||
private Long sysdeptid;
|
||||
|
||||
/** 公司ID */
|
||||
private Long syscompanyid;
|
||||
|
||||
/** 是否删除 */
|
||||
private String is_delete;
|
||||
|
||||
/** 外部标识 */
|
||||
private String ext_id;
|
||||
}
|
||||
@@ -1,127 +0,0 @@
|
||||
|
||||
package org.nl.wms.pdm.service.impl;
|
||||
|
||||
|
||||
import cn.hutool.core.map.MapUtil;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import org.nl.modules.common.exception.BadRequestException;
|
||||
import org.nl.modules.wql.core.bean.ResultBean;
|
||||
import org.nl.modules.wql.core.bean.WQLObject;
|
||||
import org.nl.modules.wql.util.WqlUtil;
|
||||
import org.nl.wms.pdm.service.DeviceitemService;
|
||||
import org.nl.wms.pdm.service.dto.DeviceitemDto;
|
||||
|
||||
|
||||
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author geng by
|
||||
* @description 服务实现
|
||||
* @date 2022-05-25
|
||||
**/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
@Slf4j
|
||||
public class DeviceitemServiceImpl implements DeviceitemService {
|
||||
|
||||
@Override
|
||||
public Map<String, Object> queryAll(Map whereJson, Pageable page) {
|
||||
WQLObject wo = WQLObject.getWQLObject("pdm_bi_deviceitem");
|
||||
final String search = MapUtil.getStr(whereJson, "search");
|
||||
String where = "";
|
||||
if (!StrUtil.isEmpty(search)) {
|
||||
where = " AND (item_code like '%" + search + "%' OR item_name like '%" + search + "%' ) ";
|
||||
}
|
||||
ResultBean rb = wo.pagequery(WqlUtil.getHttpContext(page), "1 = 1" + where, "order_seq");
|
||||
final JSONObject json = rb.pageResult();
|
||||
final JSONArray array = json.getJSONArray("content");
|
||||
for (int i = 0; i < array.size(); i++) {
|
||||
final JSONObject jsonObject = array.getJSONObject(i);
|
||||
jsonObject.put("is_show","1");
|
||||
}
|
||||
return json;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DeviceitemDto> queryAll(Map whereJson) {
|
||||
WQLObject wo = WQLObject.getWQLObject("pdm_bi_deviceitem");
|
||||
JSONArray arr = wo.query().getResultJSONArray(0);
|
||||
if (ObjectUtil.isNotEmpty(arr)) return arr.toJavaList(DeviceitemDto.class);
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public DeviceitemDto findById(Long item_id) {
|
||||
WQLObject wo = WQLObject.getWQLObject("pdm_bi_deviceitem");
|
||||
JSONObject json = wo.query("item_id = '" + item_id + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isNotEmpty(json)) {
|
||||
return json.toJavaObject(DeviceitemDto.class);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public DeviceitemDto findByCode(String code) {
|
||||
WQLObject wo = WQLObject.getWQLObject("pdm_bi_deviceitem");
|
||||
JSONObject json = wo.query("item_code ='" + code + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isNotEmpty(json)) {
|
||||
return json.toJavaObject(DeviceitemDto.class);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void create(DeviceitemDto dto) {
|
||||
//编码唯一性校验
|
||||
String item_code = dto.getItem_code();
|
||||
DeviceitemDto byCode = this.findByCode(item_code);
|
||||
if (ObjectUtil.isNotEmpty(byCode)) throw new BadRequestException("编码已存在!");
|
||||
dto.setItem_id(IdUtil.getSnowflake(1, 1).nextId());
|
||||
WQLObject wo = WQLObject.getWQLObject("pdm_bi_deviceitem");
|
||||
JSONObject json = JSONObject.parseObject(JSON.toJSONString(dto));
|
||||
wo.insert(json);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void update(DeviceitemDto dto) {
|
||||
DeviceitemDto entity = this.findById(dto.getItem_id());
|
||||
if (entity == null) throw new BadRequestException("被删除或无权限,操作失败!");
|
||||
|
||||
//编码唯一性校验
|
||||
WQLObject wo = WQLObject.getWQLObject("PDM_BI_DeviceItem");
|
||||
String where = "item_code = '" + dto.getItem_code() + "' and item_id != '" + dto.getItem_id()+"'";
|
||||
|
||||
JSONObject jsonObject = wo.query(where).uniqueResult(0);
|
||||
if (ObjectUtil.isNotEmpty(jsonObject)) {
|
||||
throw new BadRequestException("编码已存在!");
|
||||
}
|
||||
JSONObject json = JSONObject.parseObject(JSON.toJSONString(dto));
|
||||
wo.update(json);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void deleteAll(Long[] ids) {
|
||||
WQLObject wo = WQLObject.getWQLObject("pdm_bi_deviceitem");
|
||||
for (Long item_id : ids) {
|
||||
wo.delete("item_id = '" + item_id + "'");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
package org.nl.wms.mps.service.impl;
|
||||
package org.nl.wms.pdm.service.impl;
|
||||
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
@@ -23,8 +23,8 @@ import org.nl.modules.wql.core.bean.WQLObject;
|
||||
import org.nl.modules.wql.util.WqlUtil;
|
||||
import org.nl.wms.basedata.master.service.ClassstandardService;
|
||||
import org.nl.wms.ext.acs.service.WmsToAcsService;
|
||||
import org.nl.wms.mps.service.ProduceshiftorderService;
|
||||
import org.nl.wms.mps.service.dto.ProduceshiftorderDto;
|
||||
import org.nl.wms.pdm.service.ProduceshiftorderService;
|
||||
import org.nl.wms.pdm.service.dto.ProduceshiftorderDto;
|
||||
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.stereotype.Service;
|
||||
@@ -55,7 +55,6 @@ public class ProduceshiftorderServiceImpl implements ProduceshiftorderService {
|
||||
String order_type_scode = MapUtil.getStr(whereJson, "order_type_scode");
|
||||
String order_status = MapUtil.getStr(whereJson, "order_status");
|
||||
String shift_type_scode = MapUtil.getStr(whereJson, "shift_type_scode");
|
||||
String sale_id = MapUtil.getStr(whereJson, "sale_id");
|
||||
JSONObject map = new JSONObject();
|
||||
map.put("flag", "1");
|
||||
map.put("order_type_scode", order_type_scode);
|
||||
@@ -78,9 +77,6 @@ public class ProduceshiftorderServiceImpl implements ProduceshiftorderService {
|
||||
if (StrUtil.isNotEmpty(material)) {
|
||||
map.put("material", "%" + material + "%");
|
||||
}
|
||||
if (StrUtil.isNotEmpty(sale_id)) {
|
||||
map.put("sale_id", "%" + sale_id + "%");
|
||||
}
|
||||
JSONObject jsonObject = WQL.getWO("MPS_PRODUCEDURE001").addParamMap(map).pageQuery(WqlUtil.getHttpContext(page), "ShiftOrder.update_time desc");
|
||||
return jsonObject;
|
||||
}
|
||||
@@ -15,7 +15,6 @@
|
||||
#################################################
|
||||
输入.flag TYPEAS s_string
|
||||
输入.jockey_id TYPEAS s_string
|
||||
输入.sale_id TYPEAS s_string
|
||||
输入.produceorder_id TYPEAS s_string
|
||||
输入.workprocedure_id TYPEAS s_string
|
||||
输入.order_type_scode TYPEAS s_string
|
||||
@@ -88,9 +87,6 @@
|
||||
OPTION 输入.end_time <> ""
|
||||
ShiftOrder.produce_date <= 输入.end_time
|
||||
ENDOPTION
|
||||
OPTION 输入.sale_id <> ""
|
||||
ShiftOrder.sale_id like 输入.sale_id
|
||||
ENDOPTION
|
||||
OPTION 输入.produceorder_code <> ""
|
||||
ShiftOrder.produceorder_code like 输入.produceorder_code
|
||||
ENDOPTION
|
||||
@@ -1,64 +0,0 @@
|
||||
[交易说明]
|
||||
交易名: 工厂日历分页查询
|
||||
所属模块:
|
||||
功能简述:
|
||||
版权所有:
|
||||
表引用:
|
||||
版本经历:
|
||||
|
||||
[数据库]
|
||||
--指定数据库,为空采用默认值,默认为db.properties中列出的第一个库
|
||||
|
||||
[IO定义]
|
||||
#################################################
|
||||
## 表字段对应输入参数
|
||||
#################################################
|
||||
输入.flag TYPEAS s_string
|
||||
输入.search TYPEAS s_string
|
||||
输入.processroute_code TYPEAS s_string
|
||||
|
||||
|
||||
[临时表]
|
||||
--这边列出来的临时表就会在运行期动态创建
|
||||
|
||||
[临时变量]
|
||||
--所有中间过程变量均可在此处定义
|
||||
|
||||
[业务过程]
|
||||
|
||||
##########################################
|
||||
# 1、输入输出检查 #
|
||||
##########################################
|
||||
|
||||
|
||||
##########################################
|
||||
# 2、主过程前处理 #
|
||||
##########################################
|
||||
|
||||
|
||||
##########################################
|
||||
# 3、业务主过程 #
|
||||
##########################################
|
||||
|
||||
IF 输入.flag = "1"
|
||||
PAGEQUERY
|
||||
SELECT
|
||||
dar.*,
|
||||
(
|
||||
case when dar.is_active = '0' then '否'
|
||||
when dar.is_active = '1' then '是' end) AS active_name
|
||||
FROM
|
||||
pdm_bi_factorycalendar dar
|
||||
WHERE
|
||||
1=1
|
||||
OPTION 输入.search <> ""
|
||||
(dar.factorycalendar_code like 输入.search or
|
||||
dar.factorycalendar_name like 输入.search)
|
||||
ENDOPTION
|
||||
ENDSELECT
|
||||
ENDPAGEQUERY
|
||||
ENDIF
|
||||
|
||||
|
||||
|
||||
|
||||
Binary file not shown.
@@ -82,14 +82,6 @@ public class PointController {
|
||||
return new ResponseEntity<>(pointService.getPoint(whereJson), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PutMapping("/syncStruct")
|
||||
@Log("仓位同步")
|
||||
@ApiOperation("仓位同步")
|
||||
//@SaCheckPermission("store:edit")
|
||||
public ResponseEntity<Object> syncStruct() {
|
||||
pointService.syncStruct();
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
@GetMapping("/selectPoint")
|
||||
@Log("查询点位管理")
|
||||
@ApiOperation("查询点位管理")
|
||||
|
||||
@@ -66,14 +66,4 @@ public class RegionController {
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PutMapping("/changeActive")
|
||||
@Log("修改点位启用状态")
|
||||
@ApiOperation("修改点位启用状态")
|
||||
//@SaCheckPermission("store:edit")
|
||||
public ResponseEntity<Object> update(@RequestBody JSONObject json) {
|
||||
regionService.changeActive(json);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -73,7 +73,6 @@ public interface PointService {
|
||||
|
||||
JSONArray getPoint(Map wherJson);
|
||||
|
||||
void syncStruct();
|
||||
/**
|
||||
*
|
||||
* 获取点位
|
||||
|
||||
@@ -1,14 +1,11 @@
|
||||
|
||||
package org.nl.wms.sch.service;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.nl.wms.sch.service.dto.RegionDto;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.List;
|
||||
import java.io.IOException;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author Liuxy
|
||||
@@ -72,5 +69,4 @@ public interface RegionService {
|
||||
*/
|
||||
void deleteAll(Long[] ids);
|
||||
|
||||
void changeActive(JSONObject json);
|
||||
}
|
||||
|
||||
@@ -8,11 +8,8 @@ import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.mchange.lang.DoubleUtils;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
|
||||
import org.nl.modules.common.exception.BadRequestException;
|
||||
import org.nl.modules.common.utils.SecurityUtils;
|
||||
import org.nl.modules.wql.WQL;
|
||||
@@ -20,7 +17,6 @@ import org.nl.modules.wql.core.bean.WQLObject;
|
||||
import org.nl.modules.wql.util.WqlUtil;
|
||||
import org.nl.wms.sch.service.PointService;
|
||||
import org.nl.wms.sch.service.dto.PointDto;
|
||||
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
@@ -198,38 +194,6 @@ public class PointServiceImpl implements PointService {
|
||||
return point_rows;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void syncStruct() {
|
||||
WQLObject.getWQLObject("sch_base_point").delete(" point_type = '01'");
|
||||
Long currentUserId = SecurityUtils.getCurrentUserId();
|
||||
String nickName = SecurityUtils.getCurrentNickName();
|
||||
String now = DateUtil.now();
|
||||
JSONObject map = new JSONObject();
|
||||
map.put("flag", "2");
|
||||
JSONArray arrStruct = WQL.getWO("QSCH_BASE_POINT").addParamMap(map).process().getResultJSONArray(0);
|
||||
WQLObject wo = WQLObject.getWQLObject("sch_base_point");
|
||||
for (int i = 0; i < arrStruct.size(); i++) {
|
||||
JSONObject json = arrStruct.getJSONObject(i);
|
||||
JSONObject structMap = new JSONObject();
|
||||
structMap.put("point_id", json.getString("struct_id"));
|
||||
structMap.put("point_code", json.getString("struct_code"));
|
||||
structMap.put("point_name", json.getString("struct_name"));
|
||||
structMap.put("region_id", json.getString("region_id"));
|
||||
structMap.put("source_id", json.getString("struct_id"));
|
||||
structMap.put("point_type", "01");
|
||||
structMap.put("is_host", "0");
|
||||
structMap.put("is_used", json.getString("is_used"));
|
||||
structMap.put("create_id", currentUserId);
|
||||
structMap.put("create_name", nickName);
|
||||
structMap.put("create_time", now);
|
||||
structMap.put("update_optid", currentUserId);
|
||||
structMap.put("update_optname", nickName);
|
||||
structMap.put("update_time", now);
|
||||
wo.insert(structMap);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> selectPoint(Map whereJson, Pageable page) {
|
||||
String search = MapUtil.getStr(whereJson, "search");
|
||||
|
||||
@@ -2,11 +2,15 @@
|
||||
package org.nl.wms.sch.service.impl;
|
||||
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.map.MapUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.modules.common.exception.BadRequestException;
|
||||
import org.nl.modules.common.utils.SecurityUtils;
|
||||
import org.nl.modules.wql.WQL;
|
||||
@@ -14,27 +18,14 @@ import org.nl.modules.wql.core.bean.WQLObject;
|
||||
import org.nl.modules.wql.util.WqlUtil;
|
||||
import org.nl.wms.sch.service.RegionService;
|
||||
import org.nl.wms.sch.service.dto.RegionDto;
|
||||
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import org.springframework.data.domain.Pageable;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
|
||||
|
||||
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
|
||||
/**
|
||||
* @author Liuxy
|
||||
* @description 服务实现
|
||||
@@ -138,21 +129,4 @@ public class RegionServiceImpl implements RegionService {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void changeActive(JSONObject json) {
|
||||
Long currentUserId = SecurityUtils.getCurrentUserId();
|
||||
String nickName = SecurityUtils.getCurrentNickName();
|
||||
String now = DateUtil.now();
|
||||
|
||||
String is_used = "1";
|
||||
if (StrUtil.equals("1", json.getString("is_used"))) {
|
||||
is_used = "0";
|
||||
}
|
||||
json.put("is_used", is_used);
|
||||
json.put("update_optid", currentUserId);
|
||||
json.put("update_optname", nickName);
|
||||
json.put("update_time", now);
|
||||
WQLObject.getWQLObject("sch_base_region").update(json);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Binary file not shown.
Reference in New Issue
Block a user