diff --git a/nladmin-system/src/main/java/org/nl/Test01.java b/nladmin-system/src/main/java/org/nl/Test01.java deleted file mode 100644 index fc4aa6a74..000000000 --- a/nladmin-system/src/main/java/org/nl/Test01.java +++ /dev/null @@ -1,2 +0,0 @@ -package org.nl;public class Test01 { -} diff --git a/nladmin-system/src/main/java/org/nl/wms/pdm/ivt/rest/CoolPointIvtController.java b/nladmin-system/src/main/java/org/nl/wms/pdm/ivt/rest/CoolPointIvtController.java new file mode 100644 index 000000000..abd385d9d --- /dev/null +++ b/nladmin-system/src/main/java/org/nl/wms/pdm/ivt/rest/CoolPointIvtController.java @@ -0,0 +1,67 @@ + +package org.nl.wms.pdm.ivt.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.ivt.service.CoolPointIvtService; +import org.nl.wms.pdm.ivt.service.dto.CoolPointIvtDto; +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 lyd +* @date 2022-10-08 +**/ +@RestController +@RequiredArgsConstructor +@Api(tags = "冷却区库存管理") +@RequestMapping("/api/stIvtCoolpointivt") +@Slf4j +public class CoolPointIvtController { + + private final CoolPointIvtService coolpointivtService; + + @GetMapping + @Log("查询冷却区库存") + @ApiOperation("查询冷却区库存") + //@SaCheckPermission("@el.check('stIvtCoolpointivt:list')") + public ResponseEntity query(@RequestParam Map whereJson, Pageable page){ + return new ResponseEntity<>(coolpointivtService.queryAll(whereJson,page),HttpStatus.OK); + } + + @PostMapping + @Log("新增冷却区库存") + @ApiOperation("新增冷却区库存") + //@SaCheckPermission("@el.check('stIvtCoolpointivt:add')") + public ResponseEntity create(@Validated @RequestBody CoolPointIvtDto dto){ + coolpointivtService.create(dto); + return new ResponseEntity<>(HttpStatus.CREATED); + } + + @PutMapping + @Log("修改冷却区库存") + @ApiOperation("修改冷却区库存") + //@SaCheckPermission("@el.check('stIvtCoolpointivt:edit')") + public ResponseEntity update(@Validated @RequestBody CoolPointIvtDto dto){ + coolpointivtService.update(dto); + return new ResponseEntity<>(HttpStatus.NO_CONTENT); + } + + @Log("删除冷却区库存") + @ApiOperation("删除冷却区库存") + //@SaCheckPermission("@el.check('stIvtCoolpointivt:del')") + @DeleteMapping + public ResponseEntity delete(@RequestBody Long[] ids) { + coolpointivtService.deleteAll(ids); + return new ResponseEntity<>(HttpStatus.OK); + } +} diff --git a/nladmin-system/src/main/java/org/nl/wms/pdm/ivt/rest/CutPointIvtController.java b/nladmin-system/src/main/java/org/nl/wms/pdm/ivt/rest/CutPointIvtController.java new file mode 100644 index 000000000..4efaa6499 --- /dev/null +++ b/nladmin-system/src/main/java/org/nl/wms/pdm/ivt/rest/CutPointIvtController.java @@ -0,0 +1,67 @@ + +package org.nl.wms.pdm.ivt.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.ivt.service.CutPointIvtService; +import org.nl.wms.pdm.ivt.service.dto.CutPointIvtDto; +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 lyd +* @date 2022-10-08 +**/ +@RestController +@RequiredArgsConstructor +@Api(tags = "分切区点库存管理") +@RequestMapping("/api/cutpointivt") +@Slf4j +public class CutPointIvtController { + + private final CutPointIvtService cutpointivtService; + + @GetMapping + @Log("查询分切区点库存") + @ApiOperation("查询分切区点库存") + //@SaCheckPermission("@el.check('cutpointivt:list')") + public ResponseEntity query(@RequestParam Map whereJson, Pageable page){ + return new ResponseEntity<>(cutpointivtService.queryAll(whereJson,page),HttpStatus.OK); + } + + @PostMapping + @Log("新增分切区点库存") + @ApiOperation("新增分切区点库存") + //@SaCheckPermission("@el.check('cutpointivt:add')") + public ResponseEntity create(@Validated @RequestBody CutPointIvtDto dto){ + cutpointivtService.create(dto); + return new ResponseEntity<>(HttpStatus.CREATED); + } + + @PutMapping + @Log("修改分切区点库存") + @ApiOperation("修改分切区点库存") + //@SaCheckPermission("@el.check('cutpointivt:edit')") + public ResponseEntity update(@Validated @RequestBody CutPointIvtDto dto){ + cutpointivtService.update(dto); + return new ResponseEntity<>(HttpStatus.NO_CONTENT); + } + + @Log("删除分切区点库存") + @ApiOperation("删除分切区点库存") + //@SaCheckPermission("@el.check('cutpointivt:del')") + @DeleteMapping + public ResponseEntity delete(@RequestBody Long[] ids) { + cutpointivtService.deleteAll(ids); + return new ResponseEntity<>(HttpStatus.OK); + } +} diff --git a/nladmin-system/src/main/java/org/nl/wms/pdm/ivt/rest/DeliveryPointIvtController.java b/nladmin-system/src/main/java/org/nl/wms/pdm/ivt/rest/DeliveryPointIvtController.java new file mode 100644 index 000000000..e6f23ab71 --- /dev/null +++ b/nladmin-system/src/main/java/org/nl/wms/pdm/ivt/rest/DeliveryPointIvtController.java @@ -0,0 +1,67 @@ + +package org.nl.wms.pdm.ivt.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.ivt.service.DeliveryPointIvtService; +import org.nl.wms.pdm.ivt.service.dto.DeliveryPointIvtDto; +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 lyd +* @date 2022-10-08 +**/ +@RestController +@RequiredArgsConstructor +@Api(tags = "分切输送线管理") +@RequestMapping("/api/deliverypointivt") +@Slf4j +public class DeliveryPointIvtController { + + private final DeliveryPointIvtService deliverypointivtService; + + @GetMapping + @Log("查询分切输送线") + @ApiOperation("查询分切输送线") + //@SaCheckPermission("@el.check('deliverypointivt:list')") + public ResponseEntity query(@RequestParam Map whereJson, Pageable page){ + return new ResponseEntity<>(deliverypointivtService.queryAll(whereJson,page),HttpStatus.OK); + } + + @PostMapping + @Log("新增分切输送线") + @ApiOperation("新增分切输送线") + //@SaCheckPermission("@el.check('deliverypointivt:add')") + public ResponseEntity create(@Validated @RequestBody DeliveryPointIvtDto dto){ + deliverypointivtService.create(dto); + return new ResponseEntity<>(HttpStatus.CREATED); + } + + @PutMapping + @Log("修改分切输送线") + @ApiOperation("修改分切输送线") + //@SaCheckPermission("@el.check('deliverypointivt:edit')") + public ResponseEntity update(@Validated @RequestBody DeliveryPointIvtDto dto){ + deliverypointivtService.update(dto); + return new ResponseEntity<>(HttpStatus.NO_CONTENT); + } + + @Log("删除分切输送线") + @ApiOperation("删除分切输送线") + //@SaCheckPermission("@el.check('deliverypointivt:del')") + @DeleteMapping + public ResponseEntity delete(@RequestBody Long[] ids) { + deliverypointivtService.deleteAll(ids); + return new ResponseEntity<>(HttpStatus.OK); + } +} diff --git a/nladmin-system/src/main/java/org/nl/wms/pdm/ivt/service/CoolPointIvtService.java b/nladmin-system/src/main/java/org/nl/wms/pdm/ivt/service/CoolPointIvtService.java new file mode 100644 index 000000000..cbcba5bcf --- /dev/null +++ b/nladmin-system/src/main/java/org/nl/wms/pdm/ivt/service/CoolPointIvtService.java @@ -0,0 +1,64 @@ + +package org.nl.wms.pdm.ivt.service; + +import org.nl.wms.pdm.ivt.service.dto.CoolPointIvtDto; +import org.springframework.data.domain.Pageable; + +import java.util.List; +import java.util.Map; + +/** +* @description 服务接口 +* @author lyd +* @date 2022-10-08 +**/ +public interface CoolPointIvtService { + + /** + * 查询数据分页 + * @param whereJson 条件 + * @param page 分页参数 + * @return Map + */ + Map queryAll(Map whereJson, Pageable page); + + /** + * 查询所有数据不分页 + * @param whereJson 条件参数 + * @return List + */ + List queryAll(Map whereJson); + + /** + * 根据ID查询 + * @param ivt_id ID + * @return StIvtCoolpointivt + */ + CoolPointIvtDto findById(Long ivt_id); + + /** + * 根据编码查询 + * @param code code + * @return StIvtCoolpointivt + */ + CoolPointIvtDto findByCode(String code); + + + /** + * 创建 + * @param dto / + */ + void create(CoolPointIvtDto dto); + + /** + * 编辑 + * @param dto / + */ + void update(CoolPointIvtDto dto); + + /** + * 多选删除 + * @param ids / + */ + void deleteAll(Long[] ids); +} diff --git a/nladmin-system/src/main/java/org/nl/wms/pdm/ivt/service/CutPointIvtService.java b/nladmin-system/src/main/java/org/nl/wms/pdm/ivt/service/CutPointIvtService.java new file mode 100644 index 000000000..f1b9f67eb --- /dev/null +++ b/nladmin-system/src/main/java/org/nl/wms/pdm/ivt/service/CutPointIvtService.java @@ -0,0 +1,64 @@ + +package org.nl.wms.pdm.ivt.service; + +import org.nl.wms.pdm.ivt.service.dto.CutPointIvtDto; +import org.springframework.data.domain.Pageable; + +import java.util.List; +import java.util.Map; + +/** +* @description 服务接口 +* @author lyd +* @date 2022-10-08 +**/ +public interface CutPointIvtService { + +/** +* 查询数据分页 +* @param whereJson 条件 +* @param page 分页参数 +* @return Map +*/ +Map queryAll(Map whereJson, Pageable page); + + /** + * 查询所有数据不分页 + * @param whereJson 条件参数 + * @return List + */ + List queryAll(Map whereJson); + + /** + * 根据ID查询 + * @param ivt_id ID + * @return Cutpointivt + */ + CutPointIvtDto findById(Long ivt_id); + + /** + * 根据编码查询 + * @param code code + * @return Cutpointivt + */ + CutPointIvtDto findByCode(String code); + + + /** + * 创建 + * @param dto / + */ + void create(CutPointIvtDto dto); + + /** + * 编辑 + * @param dto / + */ + void update(CutPointIvtDto dto); + + /** + * 多选删除 + * @param ids / + */ + void deleteAll(Long[] ids); +} diff --git a/nladmin-system/src/main/java/org/nl/wms/pdm/ivt/service/DeliveryPointIvtService.java b/nladmin-system/src/main/java/org/nl/wms/pdm/ivt/service/DeliveryPointIvtService.java new file mode 100644 index 000000000..8dead1ad7 --- /dev/null +++ b/nladmin-system/src/main/java/org/nl/wms/pdm/ivt/service/DeliveryPointIvtService.java @@ -0,0 +1,64 @@ + +package org.nl.wms.pdm.ivt.service; + +import org.nl.wms.pdm.ivt.service.dto.DeliveryPointIvtDto; +import org.springframework.data.domain.Pageable; + +import java.util.List; +import java.util.Map; + +/** +* @description 服务接口 +* @author lyd +* @date 2022-10-08 +**/ +public interface DeliveryPointIvtService { + +/** +* 查询数据分页 +* @param whereJson 条件 +* @param page 分页参数 +* @return Map +*/ +Map queryAll(Map whereJson, Pageable page); + + /** + * 查询所有数据不分页 + * @param whereJson 条件参数 + * @return List + */ + List queryAll(Map whereJson); + + /** + * 根据ID查询 + * @param ivt_id ID + * @return Deliverypointivt + */ + DeliveryPointIvtDto findById(Long ivt_id); + + /** + * 根据编码查询 + * @param code code + * @return Deliverypointivt + */ + DeliveryPointIvtDto findByCode(String code); + + + /** + * 创建 + * @param dto / + */ + void create(DeliveryPointIvtDto dto); + + /** + * 编辑 + * @param dto / + */ + void update(DeliveryPointIvtDto dto); + + /** + * 多选删除 + * @param ids / + */ + void deleteAll(Long[] ids); +} diff --git a/nladmin-system/src/main/java/org/nl/wms/pdm/ivt/service/dto/CoolPointIvtDto.java b/nladmin-system/src/main/java/org/nl/wms/pdm/ivt/service/dto/CoolPointIvtDto.java new file mode 100644 index 000000000..4623dae31 --- /dev/null +++ b/nladmin-system/src/main/java/org/nl/wms/pdm/ivt/service/dto/CoolPointIvtDto.java @@ -0,0 +1,97 @@ +package org.nl.wms.pdm.ivt.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 lyd +* @date 2022-10-08 +**/ +@Data +public class CoolPointIvtDto implements Serializable { + + /** 库存记录标识 */ + /** 防止精度丢失 */ + @JsonSerialize(using= ToStringSerializer.class) + private Long ivt_id; + + /** 点位编码 */ + private String point_code; + + /** 满轴位编码 */ + private String full_point_code; + + /** 母卷号 */ + private String container_name; + + /** 母卷工单标识 */ + private String workorder_id; + + /** 母卷轴编码 */ + private String full_vehicle_code; + + /** 空轴位编码 */ + private String empty_point_code; + + /** 空轴编码 */ + private String empty_vehicle_code; + + /** 下料区域标识 */ + private Long region_id; + + /** 批次 */ + private String pcsn; + + /** 库存数 */ + private BigDecimal ivt_qty; + + /** 计量单位标识 */ + private Long qty_unit_id; + + /** 入库时间 */ + private String instorage_time; + + /** 生产区域 */ + private String product_area; + + /** 位置 */ + private String point_location; + + /** 顺序号 */ + private BigDecimal sort_seq; + + /** 是否启用 */ + private String is_used; + + /** 备注 */ + 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 String full_point_status; + + /** 空轴位状态 */ + private String empty_point_status; +} diff --git a/nladmin-system/src/main/java/org/nl/wms/pdm/ivt/service/dto/CutPointIvtDto.java b/nladmin-system/src/main/java/org/nl/wms/pdm/ivt/service/dto/CutPointIvtDto.java new file mode 100644 index 000000000..b1228ea2c --- /dev/null +++ b/nladmin-system/src/main/java/org/nl/wms/pdm/ivt/service/dto/CutPointIvtDto.java @@ -0,0 +1,79 @@ +package org.nl.wms.pdm.ivt.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 lyd +* @date 2022-10-08 +**/ +@Data +public class CutPointIvtDto implements Serializable { + + /** 库存记录标识 */ + /** 防止精度丢失 */ + @JsonSerialize(using= ToStringSerializer.class) + private Long ivt_id; + + /** 点位编码 */ + private String point_code; + + /** 满轴位编码 */ + private String full_point_code; + + /** 满轴位状态 */ + private String full_point_status; + + /** 母卷号 */ + private String container_name; + + /** 母卷轴编码 */ + private String full_vehicle_code; + + /** 空轴位编码 */ + private String empty_point_code; + + /** 空轴位状态 */ + private String empty_point_status; + + /** 空轴编码 */ + private String empty_vehicle_code; + + /** 生产区域 */ + private String product_area; + + /** 位置 */ + private String point_location; + + /** 顺序号 */ + private BigDecimal sort_seq; + + /** 是否启用 */ + private String is_used; + + /** 备注 */ + 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; +} diff --git a/nladmin-system/src/main/java/org/nl/wms/pdm/ivt/service/dto/DeliveryPointIvtDto.java b/nladmin-system/src/main/java/org/nl/wms/pdm/ivt/service/dto/DeliveryPointIvtDto.java new file mode 100644 index 000000000..ab0055ed2 --- /dev/null +++ b/nladmin-system/src/main/java/org/nl/wms/pdm/ivt/service/dto/DeliveryPointIvtDto.java @@ -0,0 +1,58 @@ +package org.nl.wms.pdm.ivt.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 lyd +* @date 2022-10-08 +**/ +@Data +public class DeliveryPointIvtDto implements Serializable { + + /** 库存记录标识 */ + /** 防止精度丢失 */ + @JsonSerialize(using= ToStringSerializer.class) + private Long ivt_id; + + /** 点位编码 */ + private String point_code; + + /** 生产区域 */ + private String product_area; + + /** 位置 */ + private String point_location; + + /** 顺序号 */ + private BigDecimal sort_seq; + + /** 是否启用 */ + private String is_used; + + /** 备注 */ + 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; +} diff --git a/nladmin-system/src/main/java/org/nl/wms/pdm/ivt/service/impl/CoolPointIvtServiceImpl.java b/nladmin-system/src/main/java/org/nl/wms/pdm/ivt/service/impl/CoolPointIvtServiceImpl.java new file mode 100644 index 000000000..9439fd420 --- /dev/null +++ b/nladmin-system/src/main/java/org/nl/wms/pdm/ivt/service/impl/CoolPointIvtServiceImpl.java @@ -0,0 +1,131 @@ + +package org.nl.wms.pdm.ivt.service.impl; + + +import cn.hutool.core.date.DateUtil; +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.core.bean.ResultBean; +import org.nl.modules.wql.core.bean.WQLObject; +import org.nl.modules.wql.util.WqlUtil; +import org.nl.wms.pdm.ivt.service.CoolPointIvtService; +import org.nl.wms.pdm.ivt.service.dto.CoolPointIvtDto; +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; + +/** +* @description 服务实现 +* @author lyd +* @date 2022-10-08 +**/ +@Service +@RequiredArgsConstructor +@Slf4j +public class CoolPointIvtServiceImpl implements CoolPointIvtService { + +@Override +public Map queryAll(Map whereJson, Pageable page){ + WQLObject wo = WQLObject.getWQLObject("st_ivt_coolpointivt"); + ResultBean rb = wo.pagequery(WqlUtil.getHttpContext(page), "1=1", "update_time desc"); + final JSONObject json = rb.pageResult(); + return json; +} + +@Override +public List queryAll(Map whereJson){ + WQLObject wo = WQLObject.getWQLObject("st_ivt_coolpointivt"); + JSONArray arr = wo.query().getResultJSONArray(0); + if (ObjectUtil.isNotEmpty(arr)) return arr.toJavaList(CoolPointIvtDto.class); + return null; + } + + @Override + public CoolPointIvtDto findById(Long ivt_id) { + WQLObject wo = WQLObject.getWQLObject("st_ivt_coolpointivt"); + JSONObject json = wo.query("ivt_id = '" + ivt_id + "'").uniqueResult(0); + if (ObjectUtil.isNotEmpty(json)){ + return json.toJavaObject( CoolPointIvtDto.class); + } + return null; + } + + @Override + public CoolPointIvtDto findByCode(String code) { + WQLObject wo = WQLObject.getWQLObject("st_ivt_coolpointivt"); + JSONObject json = wo.query("code ='" + code + "'").uniqueResult(0); + if (ObjectUtil.isNotEmpty(json)){ + return json.toJavaObject( CoolPointIvtDto.class); + } + return null; + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void create(CoolPointIvtDto dto) { + Long currentUserId = SecurityUtils.getCurrentUserId(); + String nickName = SecurityUtils.getCurrentNickName(); + String now = DateUtil.now(); + + dto.setIvt_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); + + WQLObject wo = WQLObject.getWQLObject("st_ivt_coolpointivt"); + JSONObject json = JSONObject.parseObject(JSON.toJSONString(dto)); + wo.insert(json); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(CoolPointIvtDto dto) { + CoolPointIvtDto entity = this.findById(dto.getIvt_id()); + if (entity == null) 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); + + WQLObject wo = WQLObject.getWQLObject("st_ivt_coolpointivt"); + JSONObject json = JSONObject.parseObject(JSON.toJSONString(dto)); + wo.update(json); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void deleteAll(Long[] ids) { + Long currentUserId = SecurityUtils.getCurrentUserId(); + String nickName = SecurityUtils.getCurrentNickName(); + String now = DateUtil.now(); + + WQLObject wo = WQLObject.getWQLObject("st_ivt_coolpointivt"); + for (Long ivt_id: ids) { + JSONObject param = new JSONObject(); + param.put("ivt_id", String.valueOf(ivt_id)); + param.put("is_delete", "1"); + param.put("update_optid", currentUserId); + param.put("update_optname", nickName); + param.put("update_time", now); + wo.update(param); + } + } + + } diff --git a/nladmin-system/src/main/java/org/nl/wms/pdm/ivt/service/impl/CutPointIvtServiceImpl.java b/nladmin-system/src/main/java/org/nl/wms/pdm/ivt/service/impl/CutPointIvtServiceImpl.java new file mode 100644 index 000000000..6dbe44024 --- /dev/null +++ b/nladmin-system/src/main/java/org/nl/wms/pdm/ivt/service/impl/CutPointIvtServiceImpl.java @@ -0,0 +1,131 @@ + +package org.nl.wms.pdm.ivt.service.impl; + + +import cn.hutool.core.date.DateUtil; +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.core.bean.ResultBean; +import org.nl.modules.wql.core.bean.WQLObject; +import org.nl.modules.wql.util.WqlUtil; +import org.nl.wms.pdm.ivt.service.CutPointIvtService; +import org.nl.wms.pdm.ivt.service.dto.CutPointIvtDto; +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; + +/** +* @description 服务实现 +* @author lyd +* @date 2022-10-08 +**/ +@Service +@RequiredArgsConstructor +@Slf4j +public class CutPointIvtServiceImpl implements CutPointIvtService { + +@Override +public Map queryAll(Map whereJson, Pageable page){ + WQLObject wo = WQLObject.getWQLObject("st_ivt_cutpointivt"); + ResultBean rb = wo.pagequery(WqlUtil.getHttpContext(page), "1=1", "update_time desc"); + final JSONObject json = rb.pageResult(); + return json; +} + +@Override +public List queryAll(Map whereJson){ + WQLObject wo = WQLObject.getWQLObject("st_ivt_cutpointivt"); + JSONArray arr = wo.query().getResultJSONArray(0); + if (ObjectUtil.isNotEmpty(arr)) return arr.toJavaList(CutPointIvtDto.class); + return null; + } + + @Override + public CutPointIvtDto findById(Long ivt_id) { + WQLObject wo = WQLObject.getWQLObject("st_ivt_cutpointivt"); + JSONObject json = wo.query("ivt_id = '" + ivt_id + "'").uniqueResult(0); + if (ObjectUtil.isNotEmpty(json)){ + return json.toJavaObject( CutPointIvtDto.class); + } + return null; + } + + @Override + public CutPointIvtDto findByCode(String code) { + WQLObject wo = WQLObject.getWQLObject("st_ivt_cutpointivt"); + JSONObject json = wo.query("code ='" + code + "'").uniqueResult(0); + if (ObjectUtil.isNotEmpty(json)){ + return json.toJavaObject( CutPointIvtDto.class); + } + return null; + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void create(CutPointIvtDto dto) { + Long currentUserId = SecurityUtils.getCurrentUserId(); + String nickName = SecurityUtils.getCurrentNickName(); + String now = DateUtil.now(); + + dto.setIvt_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); + + WQLObject wo = WQLObject.getWQLObject("st_ivt_cutpointivt"); + JSONObject json = JSONObject.parseObject(JSON.toJSONString(dto)); + wo.insert(json); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(CutPointIvtDto dto) { + CutPointIvtDto entity = this.findById(dto.getIvt_id()); + if (entity == null) 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); + + WQLObject wo = WQLObject.getWQLObject("st_ivt_cutpointivt"); + JSONObject json = JSONObject.parseObject(JSON.toJSONString(dto)); + wo.update(json); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void deleteAll(Long[] ids) { + Long currentUserId = SecurityUtils.getCurrentUserId(); + String nickName = SecurityUtils.getCurrentNickName(); + String now = DateUtil.now(); + + WQLObject wo = WQLObject.getWQLObject("st_ivt_cutpointivt"); + for (Long ivt_id: ids) { + JSONObject param = new JSONObject(); + param.put("ivt_id", String.valueOf(ivt_id)); + param.put("is_delete", "1"); + param.put("update_optid", currentUserId); + param.put("update_optname", nickName); + param.put("update_time", now); + wo.update(param); + } + } + + } diff --git a/nladmin-system/src/main/java/org/nl/wms/pdm/ivt/service/impl/DeliveryPointIvtServiceImpl.java b/nladmin-system/src/main/java/org/nl/wms/pdm/ivt/service/impl/DeliveryPointIvtServiceImpl.java new file mode 100644 index 000000000..213f2cc04 --- /dev/null +++ b/nladmin-system/src/main/java/org/nl/wms/pdm/ivt/service/impl/DeliveryPointIvtServiceImpl.java @@ -0,0 +1,131 @@ + +package org.nl.wms.pdm.ivt.service.impl; + + +import cn.hutool.core.date.DateUtil; +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.core.bean.ResultBean; +import org.nl.modules.wql.core.bean.WQLObject; +import org.nl.modules.wql.util.WqlUtil; +import org.nl.wms.pdm.ivt.service.DeliveryPointIvtService; +import org.nl.wms.pdm.ivt.service.dto.DeliveryPointIvtDto; +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; + +/** +* @description 服务实现 +* @author lyd +* @date 2022-10-08 +**/ +@Service +@RequiredArgsConstructor +@Slf4j +public class DeliveryPointIvtServiceImpl implements DeliveryPointIvtService { + +@Override +public Map queryAll(Map whereJson, Pageable page){ + WQLObject wo = WQLObject.getWQLObject("st_ivt_deliverypointivt"); + ResultBean rb = wo.pagequery(WqlUtil.getHttpContext(page), "1=1", "update_time desc"); + final JSONObject json = rb.pageResult(); + return json; +} + +@Override +public List queryAll(Map whereJson){ + WQLObject wo = WQLObject.getWQLObject("st_ivt_deliverypointivt"); + JSONArray arr = wo.query().getResultJSONArray(0); + if (ObjectUtil.isNotEmpty(arr)) return arr.toJavaList(DeliveryPointIvtDto.class); + return null; + } + + @Override + public DeliveryPointIvtDto findById(Long ivt_id) { + WQLObject wo = WQLObject.getWQLObject("st_ivt_deliverypointivt"); + JSONObject json = wo.query("ivt_id = '" + ivt_id + "'").uniqueResult(0); + if (ObjectUtil.isNotEmpty(json)){ + return json.toJavaObject( DeliveryPointIvtDto.class); + } + return null; + } + + @Override + public DeliveryPointIvtDto findByCode(String code) { + WQLObject wo = WQLObject.getWQLObject("st_ivt_deliverypointivt"); + JSONObject json = wo.query("code ='" + code + "'").uniqueResult(0); + if (ObjectUtil.isNotEmpty(json)){ + return json.toJavaObject( DeliveryPointIvtDto.class); + } + return null; + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void create(DeliveryPointIvtDto dto) { + Long currentUserId = SecurityUtils.getCurrentUserId(); + String nickName = SecurityUtils.getCurrentNickName(); + String now = DateUtil.now(); + + dto.setIvt_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); + + WQLObject wo = WQLObject.getWQLObject("st_ivt_deliverypointivt"); + JSONObject json = JSONObject.parseObject(JSON.toJSONString(dto)); + wo.insert(json); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(DeliveryPointIvtDto dto) { + DeliveryPointIvtDto entity = this.findById(dto.getIvt_id()); + if (entity == null) 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); + + WQLObject wo = WQLObject.getWQLObject("st_ivt_deliverypointivt"); + JSONObject json = JSONObject.parseObject(JSON.toJSONString(dto)); + wo.update(json); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void deleteAll(Long[] ids) { + Long currentUserId = SecurityUtils.getCurrentUserId(); + String nickName = SecurityUtils.getCurrentNickName(); + String now = DateUtil.now(); + + WQLObject wo = WQLObject.getWQLObject("st_ivt_deliverypointivt"); + for (Long ivt_id: ids) { + JSONObject param = new JSONObject(); + param.put("ivt_id", String.valueOf(ivt_id)); + param.put("is_delete", "1"); + param.put("update_optid", currentUserId); + param.put("update_optname", nickName); + param.put("update_time", now); + wo.update(param); + } + } + + } diff --git a/nladmin-system/src/main/java/org/nl/wms/pdm/wql/pdm.xls b/nladmin-system/src/main/java/org/nl/wms/pdm/wql/pdm.xls index 127df1766..fcd90138f 100644 Binary files a/nladmin-system/src/main/java/org/nl/wms/pdm/wql/pdm.xls and b/nladmin-system/src/main/java/org/nl/wms/pdm/wql/pdm.xls differ diff --git a/nladmin-system/src/main/java/org/nl/wms/sch/service/wql/sch.xls b/nladmin-system/src/main/java/org/nl/wms/sch/service/wql/sch.xls index e3bc63502..669503077 100644 Binary files a/nladmin-system/src/main/java/org/nl/wms/sch/service/wql/sch.xls and b/nladmin-system/src/main/java/org/nl/wms/sch/service/wql/sch.xls differ diff --git a/nladmin-ui/src/views/wms/pdm/ivt/coolpointivt/index.vue b/nladmin-ui/src/views/wms/pdm/ivt/coolpointivt/index.vue new file mode 100644 index 000000000..3e2568370 --- /dev/null +++ b/nladmin-ui/src/views/wms/pdm/ivt/coolpointivt/index.vue @@ -0,0 +1,170 @@ + + + + + diff --git a/nladmin-ui/src/views/wms/pdm/ivt/coolpointivt/stIvtCoolpointivt.js b/nladmin-ui/src/views/wms/pdm/ivt/coolpointivt/stIvtCoolpointivt.js new file mode 100644 index 000000000..64fbbcfc3 --- /dev/null +++ b/nladmin-ui/src/views/wms/pdm/ivt/coolpointivt/stIvtCoolpointivt.js @@ -0,0 +1,27 @@ +import request from '@/utils/request' + +export function add(data) { + return request({ + url: 'api/stIvtCoolpointivt', + method: 'post', + data + }) +} + +export function del(ids) { + return request({ + url: 'api/stIvtCoolpointivt/', + method: 'delete', + data: ids + }) +} + +export function edit(data) { + return request({ + url: 'api/stIvtCoolpointivt', + method: 'put', + data + }) +} + +export default { add, edit, del } diff --git a/nladmin-ui/src/views/wms/pdm/ivt/cutpointivt/cutpointivt.js b/nladmin-ui/src/views/wms/pdm/ivt/cutpointivt/cutpointivt.js new file mode 100644 index 000000000..81940f7df --- /dev/null +++ b/nladmin-ui/src/views/wms/pdm/ivt/cutpointivt/cutpointivt.js @@ -0,0 +1,27 @@ +import request from '@/utils/request' + +export function add(data) { + return request({ + url: 'api/cutpointivt', + method: 'post', + data + }) +} + +export function del(ids) { + return request({ + url: 'api/cutpointivt/', + method: 'delete', + data: ids + }) +} + +export function edit(data) { + return request({ + url: 'api/cutpointivt', + method: 'put', + data + }) +} + +export default { add, edit, del } diff --git a/nladmin-ui/src/views/wms/pdm/ivt/cutpointivt/index.vue b/nladmin-ui/src/views/wms/pdm/ivt/cutpointivt/index.vue new file mode 100644 index 000000000..461e3717b --- /dev/null +++ b/nladmin-ui/src/views/wms/pdm/ivt/cutpointivt/index.vue @@ -0,0 +1,137 @@ + + + + + diff --git a/nladmin-ui/src/views/wms/pdm/ivt/deliverypointivt/deliverypointivt.js b/nladmin-ui/src/views/wms/pdm/ivt/deliverypointivt/deliverypointivt.js new file mode 100644 index 000000000..9552f0067 --- /dev/null +++ b/nladmin-ui/src/views/wms/pdm/ivt/deliverypointivt/deliverypointivt.js @@ -0,0 +1,27 @@ +import request from '@/utils/request' + +export function add(data) { + return request({ + url: 'api/deliverypointivt', + method: 'post', + data + }) +} + +export function del(ids) { + return request({ + url: 'api/deliverypointivt/', + method: 'delete', + data: ids + }) +} + +export function edit(data) { + return request({ + url: 'api/deliverypointivt', + method: 'put', + data + }) +} + +export default { add, edit, del } diff --git a/nladmin-ui/src/views/wms/pdm/ivt/deliverypointivt/index.vue b/nladmin-ui/src/views/wms/pdm/ivt/deliverypointivt/index.vue new file mode 100644 index 000000000..48eb46032 --- /dev/null +++ b/nladmin-ui/src/views/wms/pdm/ivt/deliverypointivt/index.vue @@ -0,0 +1,103 @@ + + + + + diff --git a/nladmin-ui/src/views/wms/sch/region/index.vue b/nladmin-ui/src/views/wms/sch/region/index.vue index 1d793ba64..1043f79ae 100644 --- a/nladmin-ui/src/views/wms/sch/region/index.vue +++ b/nladmin-ui/src/views/wms/sch/region/index.vue @@ -79,10 +79,10 @@ /> - - - - + + + +