Merge remote-tracking branch 'origin/orderChange' into orderChange
# Conflicts: # api-admin/src/main/java/com/glxp/api/admin/service/business/impl/StockOrderServiceImpl.javafeature-order-fix
commit
77957dc94a
@ -0,0 +1,81 @@
|
||||
package com.glxp.api.admin.config;
|
||||
|
||||
import cn.hutool.core.io.IORuntimeException;
|
||||
import cn.hutool.core.io.IoUtil;
|
||||
import cn.hutool.core.lang.UUID;
|
||||
import com.glxp.api.admin.dao.info.DbVersionDao;
|
||||
import com.glxp.api.admin.entity.info.DbVersionEntity;
|
||||
import com.glxp.api.admin.entity.info.SchemaData;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.boot.ApplicationArguments;
|
||||
import org.springframework.boot.ApplicationRunner;
|
||||
import org.springframework.core.annotation.Order;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.io.InputStream;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@Order(1)
|
||||
@Component
|
||||
@Slf4j
|
||||
public class HdSchemaExecutor implements ApplicationRunner {
|
||||
|
||||
@Resource
|
||||
DbVersionDao hdCommonDao;
|
||||
|
||||
private List<SchemaData> schema = new ArrayList<>();
|
||||
|
||||
@Override
|
||||
public void run(ApplicationArguments args) throws Exception {
|
||||
//初始版本列表
|
||||
buildSchemas();
|
||||
//定义sql文件路径
|
||||
String basePath = "schemas/";
|
||||
//非版本控制,初始化脚本
|
||||
ClassLoader loader = this.getClass().getClassLoader();
|
||||
//通过流的方式获取项目路径下的文件
|
||||
InputStream inputStream = loader.getResourceAsStream(basePath + "init.sql");
|
||||
//获取文件内容
|
||||
String sql = IoUtil.readUtf8(inputStream);
|
||||
try {
|
||||
//判断版本表是否存在
|
||||
int count = hdCommonDao.selectTableExist("hd_version");
|
||||
if (count == 0) {
|
||||
hdCommonDao.updateSql(sql);
|
||||
}
|
||||
for (SchemaData schemaData : schema) {
|
||||
//查询版本记录是否存在
|
||||
count = hdCommonDao.selectVersion(schemaData.getVersion());
|
||||
if (count == 0) {
|
||||
log.info("--------------执行数据脚本,版本:" + schemaData.getVersion());
|
||||
//获取对应sql脚本
|
||||
inputStream = loader.getResourceAsStream(basePath + schemaData.getFileName());
|
||||
sql = IoUtil.readUtf8(inputStream);
|
||||
hdCommonDao.updateSql(sql);
|
||||
DbVersionEntity entity = new DbVersionEntity();
|
||||
entity.setId(UUID.randomUUID().toString());
|
||||
entity.setVersion(schemaData.getVersion());
|
||||
entity.setCreated(new Date());
|
||||
entity.setRemark(schemaData.getFileName());
|
||||
//写入版本记录
|
||||
hdCommonDao.insertVersion(entity);
|
||||
}
|
||||
}
|
||||
|
||||
} catch (IORuntimeException e) {
|
||||
e.printStackTrace();
|
||||
} finally {
|
||||
//关闭流
|
||||
inputStream.close();
|
||||
}
|
||||
}
|
||||
|
||||
public void buildSchemas() {
|
||||
schema.add(new SchemaData("v2.1", "schema_v2.1.sql"));
|
||||
// schema.add(new SchemaData("v2.2", "schema_v2.2.sql"));
|
||||
// schema.add(new SchemaData("v2.3", "schema_v2.3.sql"));
|
||||
}
|
||||
}
|
@ -0,0 +1,115 @@
|
||||
package com.glxp.api.admin.controller.inventory;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.glxp.api.admin.entity.inventory.DeviceCollectOrderDetailEntity;
|
||||
import com.glxp.api.admin.req.inventory.AddDeviceCollectOrderDetailRequest;
|
||||
import com.glxp.api.admin.req.inventory.FilterDeviceCollectOrderDetailRequest;
|
||||
import com.glxp.api.admin.res.PageSimpleResponse;
|
||||
import com.glxp.api.admin.res.inventory.DeviceCollectOrderDetailResponse;
|
||||
import com.glxp.api.admin.service.inventory.DeviceCollectOrderDetailService;
|
||||
import com.glxp.api.common.enums.ResultEnum;
|
||||
import com.glxp.api.common.res.BaseResponse;
|
||||
import com.glxp.api.common.util.ResultVOUtils;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.validation.BindingResult;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 设备领用记录详情接口
|
||||
*/
|
||||
@Slf4j
|
||||
@RestController
|
||||
public class DeviceCollectDetailController {
|
||||
|
||||
@Resource
|
||||
private DeviceCollectOrderDetailService detailService;
|
||||
|
||||
/**
|
||||
* 查询领用记录详情列表
|
||||
*
|
||||
* @param detailRequest
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/device/collect/order/detail/filterList")
|
||||
public BaseResponse filterList(FilterDeviceCollectOrderDetailRequest detailRequest) {
|
||||
List<DeviceCollectOrderDetailResponse> list = detailService.filterList(detailRequest);
|
||||
PageInfo<DeviceCollectOrderDetailResponse> pageInfo = new PageInfo<>(list);
|
||||
PageSimpleResponse<DeviceCollectOrderDetailResponse> pageSimpleResponse = new PageSimpleResponse<>();
|
||||
pageSimpleResponse.setTotal(pageInfo.getTotal());
|
||||
pageSimpleResponse.setList(list);
|
||||
return ResultVOUtils.success(pageSimpleResponse);
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验条码库存信息
|
||||
*
|
||||
* @param code
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/device/collect/order/detail/checkCode")
|
||||
public BaseResponse checkCode(String code) {
|
||||
if (StrUtil.isBlank(code)) {
|
||||
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL);
|
||||
}
|
||||
return detailService.checkCode(code);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加领用记录详情
|
||||
*
|
||||
* @param addDetailRequest
|
||||
* @param bindingResult
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/device/collect/order/detail/addOrderDetail")
|
||||
public BaseResponse addOrderDetail(@RequestBody AddDeviceCollectOrderDetailRequest addDetailRequest, BindingResult bindingResult) {
|
||||
if (bindingResult.hasErrors()) {
|
||||
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
|
||||
}
|
||||
if (null == addDetailRequest || StrUtil.isBlank(addDetailRequest.getOrderIdFk())) {
|
||||
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL);
|
||||
}
|
||||
return detailService.addOrderDetail(addDetailRequest);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新设备领用记录详情
|
||||
*
|
||||
* @param detailEntity
|
||||
* @param bindingResult
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/device/collect/order/detail/updateOrderDetail")
|
||||
public BaseResponse updateOrderDetail(@RequestBody DeviceCollectOrderDetailEntity detailEntity, BindingResult bindingResult) {
|
||||
if (bindingResult.hasErrors()) {
|
||||
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
|
||||
}
|
||||
if (null == detailEntity || null == detailEntity.getId()) {
|
||||
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL);
|
||||
}
|
||||
return detailService.updateOrderDetail(detailEntity);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除领用单据详情
|
||||
*
|
||||
* @param detailRequest
|
||||
* @param bindingResult
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/device/collect/order/detail/deleteOrderDetail")
|
||||
public BaseResponse deleteOrderDetail(@RequestBody FilterDeviceCollectOrderDetailRequest detailRequest, BindingResult bindingResult) {
|
||||
if (bindingResult.hasErrors()) {
|
||||
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
|
||||
}
|
||||
return detailService.deleteOrderDetail(detailRequest);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,134 @@
|
||||
package com.glxp.api.admin.controller.inventory;
|
||||
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.glxp.api.admin.entity.inventory.DeviceCollectOrderEntity;
|
||||
import com.glxp.api.admin.req.inventory.FilterDeviceCollectOrderRequest;
|
||||
import com.glxp.api.admin.res.PageSimpleResponse;
|
||||
import com.glxp.api.admin.res.inventory.DeviceCollectOrderResponse;
|
||||
import com.glxp.api.admin.service.inventory.DeviceCollectOrderService;
|
||||
import com.glxp.api.common.enums.ResultEnum;
|
||||
import com.glxp.api.common.res.BaseResponse;
|
||||
import com.glxp.api.common.util.ResultVOUtils;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.validation.BindingResult;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 设备领用记录接口
|
||||
*/
|
||||
@Slf4j
|
||||
@RestController
|
||||
public class DeviceCollectOrderController {
|
||||
|
||||
@Resource
|
||||
private DeviceCollectOrderService deviceCollectOrderService;
|
||||
|
||||
/**
|
||||
* 设备领用记录列表查询接口
|
||||
*
|
||||
* @param deviceCollectOrderRequest
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/device/collect/order/filterList")
|
||||
public BaseResponse filterList(FilterDeviceCollectOrderRequest deviceCollectOrderRequest) {
|
||||
List<DeviceCollectOrderResponse> list = deviceCollectOrderService.filterList(deviceCollectOrderRequest);
|
||||
PageInfo<DeviceCollectOrderResponse> pageInfo = new PageInfo<>(list);
|
||||
PageSimpleResponse<DeviceCollectOrderResponse> pageSimpleResponse = new PageSimpleResponse<>();
|
||||
pageSimpleResponse.setTotal(pageInfo.getTotal());
|
||||
pageSimpleResponse.setList(list);
|
||||
return ResultVOUtils.success(pageSimpleResponse);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加设备领用记录
|
||||
*
|
||||
* @param deviceCollectOrderEntity
|
||||
*/
|
||||
@PostMapping("/device/collect/order/addOrder")
|
||||
public BaseResponse addOrder(@RequestBody DeviceCollectOrderEntity deviceCollectOrderEntity, BindingResult bindingResult) {
|
||||
if (bindingResult.hasErrors() || null == deviceCollectOrderEntity) {
|
||||
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
|
||||
}
|
||||
return deviceCollectOrderService.addDeviceCollectOrder(deviceCollectOrderEntity);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新设备领用记录
|
||||
*
|
||||
* @param deviceCollectOrderEntity
|
||||
* @param bindingResult
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/device/collect/order/update")
|
||||
public BaseResponse update(@RequestBody DeviceCollectOrderEntity deviceCollectOrderEntity, BindingResult bindingResult) {
|
||||
if (bindingResult.hasErrors()) {
|
||||
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL);
|
||||
}
|
||||
|
||||
if (null == deviceCollectOrderEntity || null == deviceCollectOrderEntity.getId()) {
|
||||
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL);
|
||||
}
|
||||
return deviceCollectOrderService.updateDeviceCollectOrder(deviceCollectOrderEntity);
|
||||
}
|
||||
|
||||
/**
|
||||
* 设备领用记录提交审核
|
||||
*
|
||||
* @param filterDeviceCollectOrderRequest
|
||||
* @param bindingResult
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/device/collect/order/submitAudit")
|
||||
public BaseResponse submitAudit(@RequestBody FilterDeviceCollectOrderRequest filterDeviceCollectOrderRequest, BindingResult bindingResult) {
|
||||
if (bindingResult.hasErrors()) {
|
||||
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL);
|
||||
}
|
||||
if (null == filterDeviceCollectOrderRequest || null == filterDeviceCollectOrderRequest.getId()) {
|
||||
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL);
|
||||
}
|
||||
return deviceCollectOrderService.submitAudit(filterDeviceCollectOrderRequest.getId());
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新设备领用状态
|
||||
*
|
||||
* @param filterDeviceCollectOrderRequest
|
||||
* @param bindingResult
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/device/collect/order/updateStatus")
|
||||
public BaseResponse updateStatus(@RequestBody FilterDeviceCollectOrderRequest filterDeviceCollectOrderRequest, BindingResult bindingResult) {
|
||||
if (bindingResult.hasErrors()) {
|
||||
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL);
|
||||
}
|
||||
if (null == filterDeviceCollectOrderRequest || null == filterDeviceCollectOrderRequest.getId() || null == filterDeviceCollectOrderRequest.getStatus()) {
|
||||
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL);
|
||||
}
|
||||
return deviceCollectOrderService.updateStatus(filterDeviceCollectOrderRequest.getId(), filterDeviceCollectOrderRequest.getStatus());
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除设备领用记录
|
||||
* @param filterDeviceCollectOrderRequest
|
||||
* @param bindingResult
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/device/collect/order/delete")
|
||||
public BaseResponse delete(@RequestBody FilterDeviceCollectOrderRequest filterDeviceCollectOrderRequest, BindingResult bindingResult) {
|
||||
if (bindingResult.hasErrors()) {
|
||||
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL);
|
||||
}
|
||||
if (null == filterDeviceCollectOrderRequest || null == filterDeviceCollectOrderRequest.getId()) {
|
||||
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL);
|
||||
}
|
||||
return deviceCollectOrderService.deleteDeviceCollectOrder(filterDeviceCollectOrderRequest.getId());
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,96 @@
|
||||
package com.glxp.api.admin.controller.inventory;
|
||||
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.glxp.api.admin.entity.inventory.DeviceMAOrderEntity;
|
||||
import com.glxp.api.admin.req.inventory.FilterDeviceMAOrderRequest;
|
||||
import com.glxp.api.admin.res.PageSimpleResponse;
|
||||
import com.glxp.api.admin.service.inventory.DeviceMAOrderService;
|
||||
import com.glxp.api.common.enums.ResultEnum;
|
||||
import com.glxp.api.common.res.BaseResponse;
|
||||
import com.glxp.api.common.util.ResultVOUtils;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.validation.BindingResult;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 设备养护记录接口
|
||||
*/
|
||||
@Slf4j
|
||||
@RestController
|
||||
public class DeviceMAOrderController {
|
||||
|
||||
@Resource
|
||||
private DeviceMAOrderService deviceMAOrderService;
|
||||
|
||||
/**
|
||||
* 查询设备养护记录列表
|
||||
*
|
||||
* @param filterDeviceMAOrderRequest
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/device/MA/order/filterList")
|
||||
public BaseResponse filterList(FilterDeviceMAOrderRequest filterDeviceMAOrderRequest) {
|
||||
List<DeviceMAOrderEntity> list = deviceMAOrderService.filterList(filterDeviceMAOrderRequest);
|
||||
PageInfo<DeviceMAOrderEntity> pageInfo = new PageInfo<>(list);
|
||||
PageSimpleResponse<DeviceMAOrderEntity> pageSimpleResponse = new PageSimpleResponse<>();
|
||||
pageSimpleResponse.setTotal(pageInfo.getTotal());
|
||||
pageSimpleResponse.setList(list);
|
||||
return ResultVOUtils.success(pageSimpleResponse);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加设备养护记录
|
||||
*
|
||||
* @param deviceMAOrderEntity
|
||||
* @param bindingResult
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/device/MA/order/addMAOrder")
|
||||
public BaseResponse addMAOrder(@RequestBody DeviceMAOrderEntity deviceMAOrderEntity, BindingResult bindingResult) {
|
||||
if (bindingResult.hasErrors()) {
|
||||
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
|
||||
}
|
||||
return deviceMAOrderService.addDeviceMAOrder(deviceMAOrderEntity);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新设备养护记录
|
||||
*
|
||||
* @param deviceMAOrderEntity
|
||||
* @param bindingResult
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/device/MA/order/updateMAOrder")
|
||||
public BaseResponse updateMAOrder(@RequestBody DeviceMAOrderEntity deviceMAOrderEntity, BindingResult bindingResult) {
|
||||
if (bindingResult.hasErrors()) {
|
||||
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
|
||||
}
|
||||
return deviceMAOrderService.updateDeviceMAOrder(deviceMAOrderEntity);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除设备养护记录
|
||||
*
|
||||
* @param filterDeviceMAOrderRequest
|
||||
* @param bindingResult
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/device/MA/order/deleteMAOrder")
|
||||
public BaseResponse deleteMAOrder(@RequestBody FilterDeviceMAOrderRequest filterDeviceMAOrderRequest, BindingResult bindingResult) {
|
||||
if (bindingResult.hasErrors()) {
|
||||
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
|
||||
}
|
||||
if (null == filterDeviceMAOrderRequest || null == filterDeviceMAOrderRequest.getId()) {
|
||||
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL);
|
||||
}
|
||||
return deviceMAOrderService.deleteDeviceMAOrder(filterDeviceMAOrderRequest.getId());
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,91 @@
|
||||
package com.glxp.api.admin.controller.inventory;
|
||||
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.glxp.api.admin.entity.inventory.DeviceMAOrderDetailEntity;
|
||||
import com.glxp.api.admin.req.inventory.FilterDeviceMAOrderDetailRequest;
|
||||
import com.glxp.api.admin.res.PageSimpleResponse;
|
||||
import com.glxp.api.admin.res.inventory.DeviceMAOrderDetailResponse;
|
||||
import com.glxp.api.admin.service.inventory.DeviceMAOrderDetailService;
|
||||
import com.glxp.api.common.enums.ResultEnum;
|
||||
import com.glxp.api.common.res.BaseResponse;
|
||||
import com.glxp.api.common.util.ResultVOUtils;
|
||||
import org.springframework.validation.BindingResult;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 设备养护记录详情接口
|
||||
*/
|
||||
@RestController
|
||||
public class DeviceMAOrderDetailCotroller {
|
||||
|
||||
@Resource
|
||||
private DeviceMAOrderDetailService deviceMAOrderDetailService;
|
||||
|
||||
/**
|
||||
* 查询设备养护记录详情列表
|
||||
*
|
||||
* @param detailRequest
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/device/MA/order/detail/filterList")
|
||||
public BaseResponse filterList(FilterDeviceMAOrderDetailRequest detailRequest) {
|
||||
List<DeviceMAOrderDetailResponse> list = deviceMAOrderDetailService.filterList(detailRequest);
|
||||
PageInfo<DeviceMAOrderDetailResponse> pageInfo = new PageInfo<>(list);
|
||||
PageSimpleResponse<DeviceMAOrderDetailResponse> pageSimpleResponse = new PageSimpleResponse<>();
|
||||
pageSimpleResponse.setTotal(pageInfo.getTotal());
|
||||
pageSimpleResponse.setList(list);
|
||||
return ResultVOUtils.success(pageSimpleResponse);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加设备养护记录详情
|
||||
*
|
||||
* @param detailEntity
|
||||
* @param bindingResult
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/device/MA/order/detail/addOrderDetail")
|
||||
public BaseResponse addOrderDetail(@RequestBody DeviceMAOrderDetailEntity detailEntity, BindingResult bindingResult) {
|
||||
if (bindingResult.hasErrors()) {
|
||||
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
|
||||
}
|
||||
return deviceMAOrderDetailService.addDetail(detailEntity);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新设备养护记录详情
|
||||
*
|
||||
* @param detailEntity
|
||||
* @param bindingResult
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/device/MA/order/detail/updateOrderDetail")
|
||||
public BaseResponse updateOrderDetail(@RequestBody DeviceMAOrderDetailEntity detailEntity, BindingResult bindingResult) {
|
||||
if (bindingResult.hasErrors()) {
|
||||
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
|
||||
}
|
||||
return deviceMAOrderDetailService.updateDetail(detailEntity);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除设备养护记录详情
|
||||
*
|
||||
* @param detailEntity
|
||||
* @param bindingResult
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/device/MA/order/detail/deleteOrderDetail")
|
||||
public BaseResponse deleteOrderDetail(@RequestBody DeviceMAOrderDetailEntity detailEntity, BindingResult bindingResult) {
|
||||
if (bindingResult.hasErrors()) {
|
||||
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
|
||||
}
|
||||
return deviceMAOrderDetailService.deleteDetail(detailEntity);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,135 @@
|
||||
package com.glxp.api.admin.controller.inventory;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.glxp.api.admin.entity.inventory.InvMaintenanceOrderEntity;
|
||||
import com.glxp.api.admin.req.inventory.FilterInvMAOrderRequest;
|
||||
import com.glxp.api.admin.res.PageSimpleResponse;
|
||||
import com.glxp.api.admin.res.inventory.InvMAOrderResponse;
|
||||
import com.glxp.api.admin.service.inventory.InvMAOrderService;
|
||||
import com.glxp.api.common.enums.ResultEnum;
|
||||
import com.glxp.api.common.res.BaseResponse;
|
||||
import com.glxp.api.common.util.ResultVOUtils;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.validation.BindingResult;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 库存养护记录接口
|
||||
*/
|
||||
@Slf4j
|
||||
@RestController
|
||||
public class InvMAOrderController {
|
||||
|
||||
|
||||
@Resource
|
||||
private InvMAOrderService invMAOrderService;
|
||||
|
||||
/**
|
||||
* 查询养护记录列表
|
||||
*
|
||||
* @param filterInvMAOrderRequest
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/inv/MA/order/filterList")
|
||||
public BaseResponse filterList(FilterInvMAOrderRequest filterInvMAOrderRequest) {
|
||||
List<InvMAOrderResponse> list = invMAOrderService.filterList(filterInvMAOrderRequest);
|
||||
PageInfo<InvMAOrderResponse> pageInfo = new PageInfo<>(list);
|
||||
PageSimpleResponse<InvMAOrderResponse> pageSimpleResponse = new PageSimpleResponse<>();
|
||||
pageSimpleResponse.setTotal(pageInfo.getTotal());
|
||||
pageSimpleResponse.setList(pageInfo.getList());
|
||||
return ResultVOUtils.success(pageSimpleResponse);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加养护记录
|
||||
*
|
||||
* @param invMaintenanceOrder
|
||||
* @param bindingResult
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/inv/MA/order/addOrder")
|
||||
public BaseResponse addOrder(@RequestBody InvMaintenanceOrderEntity invMaintenanceOrder, BindingResult bindingResult) {
|
||||
if (bindingResult.hasErrors()) {
|
||||
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
|
||||
}
|
||||
return invMAOrderService.addOrder(invMaintenanceOrder);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新养护记录
|
||||
*
|
||||
* @param invMaintenanceOrder
|
||||
* @param bindingResult
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/inv/MA/order/update")
|
||||
public BaseResponse update(@RequestBody InvMaintenanceOrderEntity invMaintenanceOrder, BindingResult bindingResult) {
|
||||
if (bindingResult.hasErrors()) {
|
||||
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
|
||||
}
|
||||
if (null == invMaintenanceOrder || StrUtil.isBlank(invMaintenanceOrder.getOrderId())) {
|
||||
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, "参数不能为空!");
|
||||
}
|
||||
return invMAOrderService.update(invMaintenanceOrder);
|
||||
}
|
||||
|
||||
/**
|
||||
* 提交审核
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/inv/MA/order/submitAudit")
|
||||
public BaseResponse submitAudit(@RequestBody FilterInvMAOrderRequest filterInvMAOrderRequest, BindingResult bindingResult) {
|
||||
if (bindingResult.hasErrors()) {
|
||||
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
|
||||
}
|
||||
if (null == filterInvMAOrderRequest || null == filterInvMAOrderRequest.getId()) {
|
||||
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, "参数不能为空");
|
||||
}
|
||||
return invMAOrderService.submitAudit(filterInvMAOrderRequest.getId());
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新养护记录状态
|
||||
*
|
||||
* @param filterInvMAOrderRequest
|
||||
* @param bindingResult
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/inv/MA/order/updateStatus")
|
||||
public BaseResponse updateStatus(@RequestBody FilterInvMAOrderRequest filterInvMAOrderRequest, BindingResult bindingResult) {
|
||||
if (bindingResult.hasErrors()) {
|
||||
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
|
||||
}
|
||||
if (null == filterInvMAOrderRequest || null == filterInvMAOrderRequest.getId() || null == filterInvMAOrderRequest.getStatus()) {
|
||||
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, "参数不能为空!");
|
||||
}
|
||||
return invMAOrderService.updateStatus(filterInvMAOrderRequest.getId(), filterInvMAOrderRequest.getStatus());
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除养护记录
|
||||
*
|
||||
* @param filterInvMAOrderRequest
|
||||
* @param bindingResult
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/inv/MA/order/delete")
|
||||
public BaseResponse delete(@RequestBody FilterInvMAOrderRequest filterInvMAOrderRequest, BindingResult bindingResult) {
|
||||
if (bindingResult.hasErrors()) {
|
||||
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
|
||||
}
|
||||
if (null == filterInvMAOrderRequest || null == filterInvMAOrderRequest.getId()) {
|
||||
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, "参数不能为空!");
|
||||
}
|
||||
return invMAOrderService.delete(filterInvMAOrderRequest.getId());
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,120 @@
|
||||
package com.glxp.api.admin.controller.inventory;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.glxp.api.admin.entity.inventory.InvMaintenanceOrderDetailEntity;
|
||||
import com.glxp.api.admin.req.inventory.AddMAOrderDetailRequest;
|
||||
import com.glxp.api.admin.req.inventory.FilterInvMAOrderDetailRequest;
|
||||
import com.glxp.api.admin.res.PageSimpleResponse;
|
||||
import com.glxp.api.admin.res.inventory.InvMAOrderDetailResponse;
|
||||
import com.glxp.api.admin.service.inventory.InvMAOrderDetailService;
|
||||
import com.glxp.api.common.enums.ResultEnum;
|
||||
import com.glxp.api.common.res.BaseResponse;
|
||||
import com.glxp.api.common.util.ResultVOUtils;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.validation.BindingResult;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 库存养护记录详情接口
|
||||
*/
|
||||
@Slf4j
|
||||
@RestController
|
||||
public class InvMAOrderDetailController {
|
||||
|
||||
@Resource
|
||||
private InvMAOrderDetailService invMAOrderDetailService;
|
||||
|
||||
/**
|
||||
* 查询养护记录详情
|
||||
*
|
||||
* @param filterInvMAOrderDetailRequest
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/inv/MA/order/detail/filterList")
|
||||
public BaseResponse filterList(FilterInvMAOrderDetailRequest filterInvMAOrderDetailRequest) {
|
||||
List<InvMAOrderDetailResponse> list = invMAOrderDetailService.filterList(filterInvMAOrderDetailRequest);
|
||||
PageInfo<InvMAOrderDetailResponse> pageInfo = new PageInfo<>(list);
|
||||
PageSimpleResponse<InvMAOrderDetailResponse> pageSimpleResponse = new PageSimpleResponse<>();
|
||||
pageSimpleResponse.setTotal(pageInfo.getTotal());
|
||||
pageSimpleResponse.setList(pageInfo.getList());
|
||||
return ResultVOUtils.success(pageSimpleResponse);
|
||||
}
|
||||
|
||||
/**
|
||||
* 扫码添加养护记录详情
|
||||
*
|
||||
* @param invMaintenanceOrderDetailEntity
|
||||
* @param bindingResult
|
||||
* @return
|
||||
*/
|
||||
@PostMapping(" /inv/MA/order/detail/addOrderDetail")
|
||||
public BaseResponse addOrderDetail(@RequestBody InvMaintenanceOrderDetailEntity invMaintenanceOrderDetailEntity, BindingResult bindingResult) {
|
||||
if (bindingResult.hasErrors()) {
|
||||
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
|
||||
}
|
||||
if (null == invMaintenanceOrderDetailEntity || StrUtil.isBlank(invMaintenanceOrderDetailEntity.getCode()) || StrUtil.isBlank(invMaintenanceOrderDetailEntity.getOrderIdFk())) {
|
||||
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, "参数不能为空");
|
||||
}
|
||||
return invMAOrderDetailService.addOrderDetail(invMaintenanceOrderDetailEntity);
|
||||
}
|
||||
|
||||
/**
|
||||
* 选中库存详情批量添加养护记录详情
|
||||
*
|
||||
* @param invProductIds
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/inv/MA/order/detail/batchAddDetail")
|
||||
public BaseResponse batchAddDetail(@RequestBody AddMAOrderDetailRequest addMAOrderDetailRequest, BindingResult bindingResult) {
|
||||
if (bindingResult.hasErrors()) {
|
||||
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
|
||||
}
|
||||
if (null == addMAOrderDetailRequest || CollUtil.isEmpty(addMAOrderDetailRequest.getInvProductIds()) || StrUtil.isBlank(addMAOrderDetailRequest.getOrderIdFk())) {
|
||||
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, "参数不能为空!");
|
||||
}
|
||||
return invMAOrderDetailService.batchAddDetail(addMAOrderDetailRequest);
|
||||
}
|
||||
|
||||
/**
|
||||
* 减一
|
||||
*
|
||||
* @param filterInvMAOrderDetailRequest
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/inv/MA/order/detail/delete")
|
||||
public BaseResponse delete(@RequestBody FilterInvMAOrderDetailRequest filterInvMAOrderDetailRequest, BindingResult bindingResult) {
|
||||
if (bindingResult.hasErrors()) {
|
||||
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
|
||||
}
|
||||
if (null == filterInvMAOrderDetailRequest || null == filterInvMAOrderDetailRequest.getId()) {
|
||||
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, "参数不能为空");
|
||||
}
|
||||
return invMAOrderDetailService.delete(filterInvMAOrderDetailRequest.getId());
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新库存养护记录详情
|
||||
*
|
||||
* @param invMaintenanceOrderDetailEntity
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/inv/MA/order/detail/update")
|
||||
public BaseResponse update(@RequestBody InvMaintenanceOrderDetailEntity invMaintenanceOrderDetailEntity, BindingResult bindingResult) {
|
||||
if (bindingResult.hasErrors()) {
|
||||
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
|
||||
}
|
||||
if (null == invMaintenanceOrderDetailEntity || null == invMaintenanceOrderDetailEntity.getId()) {
|
||||
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, "参数不能为空!");
|
||||
}
|
||||
return invMAOrderDetailService.update(invMaintenanceOrderDetailEntity);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,24 @@
|
||||
package com.glxp.api.admin.dao.info;
|
||||
|
||||
import com.glxp.api.admin.entity.info.DbVersionEntity;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Update;
|
||||
|
||||
@Mapper
|
||||
public interface DbVersionDao {
|
||||
|
||||
int selectVersion(@Param("version") String version);
|
||||
|
||||
//查询版本表是否存在
|
||||
int selectTableExist(@Param("tableName") String tableName);
|
||||
|
||||
//新增版本
|
||||
int insertVersion(DbVersionEntity entity);
|
||||
|
||||
//执行sql
|
||||
@Update("${sql}")
|
||||
void updateSql(@Param("sql") String sql);
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,40 @@
|
||||
package com.glxp.api.admin.dao.inventory;
|
||||
|
||||
import com.glxp.api.admin.entity.inventory.DeviceCollectOrderEntity;
|
||||
import com.glxp.api.admin.req.inventory.FilterDeviceCollectOrderRequest;
|
||||
import com.glxp.api.admin.res.inventory.DeviceCollectOrderResponse;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface DeviceCollectOrderDao {
|
||||
int deleteByPrimaryKey(Integer id);
|
||||
|
||||
int insert(DeviceCollectOrderEntity record);
|
||||
|
||||
int insertSelective(DeviceCollectOrderEntity record);
|
||||
|
||||
DeviceCollectOrderEntity selectByPrimaryKey(Integer id);
|
||||
|
||||
int updateByPrimaryKeySelective(DeviceCollectOrderEntity record);
|
||||
|
||||
int updateByPrimaryKey(DeviceCollectOrderEntity record);
|
||||
|
||||
List<DeviceCollectOrderResponse> filterList(FilterDeviceCollectOrderRequest deviceCollectOrderRequest);
|
||||
|
||||
/**
|
||||
* 根据ID查询领用记录号
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
String selectOrderIdById(@Param("id") Integer id);
|
||||
|
||||
/**
|
||||
* 更新设备领用记录状态
|
||||
*
|
||||
* @param status 状态值
|
||||
* @param id
|
||||
*/
|
||||
void updateStatusById(@Param("status") int status, @Param("id") Integer id);
|
||||
}
|
@ -0,0 +1,48 @@
|
||||
package com.glxp.api.admin.dao.inventory;
|
||||
|
||||
import com.glxp.api.admin.entity.inventory.DeviceCollectOrderDetailEntity;
|
||||
import com.glxp.api.admin.req.inventory.FilterDeviceCollectOrderDetailRequest;
|
||||
import com.glxp.api.admin.res.inventory.DeviceCollectOrderDetailResponse;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface DeviceCollectOrderDetailDao {
|
||||
int deleteByPrimaryKey(Integer id);
|
||||
|
||||
int insert(DeviceCollectOrderDetailEntity record);
|
||||
|
||||
int insertSelective(DeviceCollectOrderDetailEntity record);
|
||||
|
||||
DeviceCollectOrderDetailEntity selectByPrimaryKey(Integer id);
|
||||
|
||||
int updateByPrimaryKeySelective(DeviceCollectOrderDetailEntity record);
|
||||
|
||||
int updateByPrimaryKey(DeviceCollectOrderDetailEntity record);
|
||||
|
||||
List<DeviceCollectOrderDetailEntity> selectByOrderId(String orderId);
|
||||
|
||||
/**
|
||||
* 查询领用记录详情列表
|
||||
*
|
||||
* @param detailRequest
|
||||
* @return
|
||||
*/
|
||||
List<DeviceCollectOrderDetailResponse> filterList(FilterDeviceCollectOrderDetailRequest detailRequest);
|
||||
|
||||
/**
|
||||
* 根据领用记录号删除领用记录
|
||||
*
|
||||
* @param orderIdFk
|
||||
*/
|
||||
void deleteByOrderId(@Param("orderIdFk") String orderIdFk);
|
||||
|
||||
/**
|
||||
* 查询设备领用记录详情
|
||||
*
|
||||
* @param filterDeviceCollectOrderDetailRequest
|
||||
* @return
|
||||
*/
|
||||
List<DeviceCollectOrderDetailEntity> selectList(FilterDeviceCollectOrderDetailRequest filterDeviceCollectOrderDetailRequest);
|
||||
|
||||
}
|
@ -0,0 +1,23 @@
|
||||
package com.glxp.api.admin.dao.inventory;
|
||||
|
||||
|
||||
import com.glxp.api.admin.entity.inventory.DeviceMAOrderEntity;
|
||||
import com.glxp.api.admin.req.inventory.FilterDeviceMAOrderRequest;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface DeviceMAOrderDao {
|
||||
int deleteByPrimaryKey(Integer id);
|
||||
|
||||
int insert(DeviceMAOrderEntity record);
|
||||
|
||||
int insertSelective(DeviceMAOrderEntity record);
|
||||
|
||||
DeviceMAOrderEntity selectByPrimaryKey(Integer id);
|
||||
|
||||
int updateByPrimaryKeySelective(DeviceMAOrderEntity record);
|
||||
|
||||
int updateByPrimaryKey(DeviceMAOrderEntity record);
|
||||
|
||||
List<DeviceMAOrderEntity> filterList(FilterDeviceMAOrderRequest filterDeviceMAOrderRequest);
|
||||
}
|
@ -0,0 +1,34 @@
|
||||
package com.glxp.api.admin.dao.inventory;
|
||||
|
||||
import com.glxp.api.admin.entity.inventory.DeviceMAOrderDetailEntity;
|
||||
import com.glxp.api.admin.req.inventory.FilterDeviceMAOrderDetailRequest;
|
||||
import com.glxp.api.admin.res.inventory.DeviceMAOrderDetailResponse;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface DeviceMaOrderDetailDao {
|
||||
int deleteByPrimaryKey(Integer id);
|
||||
|
||||
int insert(DeviceMAOrderDetailEntity record);
|
||||
|
||||
int insertSelective(DeviceMAOrderDetailEntity record);
|
||||
|
||||
DeviceMAOrderDetailEntity selectByPrimaryKey(Integer id);
|
||||
|
||||
int updateByPrimaryKeySelective(DeviceMAOrderDetailEntity record);
|
||||
|
||||
int updateByPrimaryKey(DeviceMAOrderDetailEntity record);
|
||||
|
||||
List<DeviceMAOrderDetailResponse> filterList(FilterDeviceMAOrderDetailRequest detailRequest);
|
||||
|
||||
void deleteByOrderId(@Param("orderIdFk") String orderIdFk);
|
||||
|
||||
/**
|
||||
* 查询此设备养护及
|
||||
*
|
||||
* @param orderId
|
||||
* @return
|
||||
*/
|
||||
List<DeviceMAOrderDetailEntity> selectByOrderId(@Param("orderId") String orderId);
|
||||
}
|
@ -0,0 +1,12 @@
|
||||
package com.glxp.api.admin.dao.inventory;
|
||||
|
||||
import com.glxp.api.admin.entity.inventory.InvMaintenanceExplanationEntity;
|
||||
|
||||
/**
|
||||
* 养护说明表Dao
|
||||
*/
|
||||
public interface InvMaintenanceExplanationDao {
|
||||
|
||||
InvMaintenanceExplanationEntity selectByStatus(Integer status);
|
||||
|
||||
}
|
@ -0,0 +1,33 @@
|
||||
package com.glxp.api.admin.dao.inventory;
|
||||
|
||||
import com.glxp.api.admin.entity.inventory.InvMaintenanceOrderEntity;
|
||||
import com.glxp.api.admin.req.inventory.FilterInvMAOrderRequest;
|
||||
import com.glxp.api.admin.res.inventory.InvMAOrderResponse;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface InvMaintenanceOrderDao {
|
||||
|
||||
int deleteByPrimaryKey(Integer id);
|
||||
|
||||
int insert(InvMaintenanceOrderEntity record);
|
||||
|
||||
int insertSelective(InvMaintenanceOrderEntity record);
|
||||
|
||||
InvMaintenanceOrderEntity selectByPrimaryKey(Integer id);
|
||||
|
||||
int updateByPrimaryKeySelective(InvMaintenanceOrderEntity record);
|
||||
|
||||
int updateByPrimaryKey(InvMaintenanceOrderEntity record);
|
||||
|
||||
List<InvMAOrderResponse> filterList(FilterInvMAOrderRequest filterInvMAOrderRequest);
|
||||
|
||||
/**
|
||||
* 根据养护记录ID查询数据
|
||||
*
|
||||
* @param orderId
|
||||
* @return
|
||||
*/
|
||||
InvMaintenanceOrderEntity selectByOrderId(@Param("orderId") String orderId);
|
||||
}
|
@ -0,0 +1,81 @@
|
||||
package com.glxp.api.admin.dao.inventory;
|
||||
|
||||
import com.glxp.api.admin.entity.inventory.InvMaintenanceOrderDetailEntity;
|
||||
import com.glxp.api.admin.req.inventory.FilterInvMAOrderDetailRequest;
|
||||
import com.glxp.api.admin.res.inventory.InvMAOrderDetailResponse;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface InvMaintenanceOrderDetailDao {
|
||||
|
||||
int deleteByPrimaryKey(Integer id);
|
||||
|
||||
int insert(InvMaintenanceOrderDetailEntity record);
|
||||
|
||||
int insertSelective(InvMaintenanceOrderDetailEntity record);
|
||||
|
||||
InvMaintenanceOrderDetailEntity selectByPrimaryKey(Integer id);
|
||||
|
||||
int updateByPrimaryKeySelective(InvMaintenanceOrderDetailEntity record);
|
||||
|
||||
int updateByPrimaryKey(InvMaintenanceOrderDetailEntity record);
|
||||
|
||||
/**
|
||||
* 根据养护记录ID删除详情
|
||||
*
|
||||
* @param orderId
|
||||
*/
|
||||
void deleteByOrderId(@Param("orderId") String orderId);
|
||||
|
||||
/**
|
||||
* 统计养护产品详情数量
|
||||
*
|
||||
* @param orderId
|
||||
* @return
|
||||
*/
|
||||
Long countByOrderId(@Param("orderId") String orderId);
|
||||
|
||||
/**
|
||||
* 查询养护记录详情
|
||||
*
|
||||
* @param filterInvMAOrderDetailRequest
|
||||
* @return
|
||||
*/
|
||||
List<InvMAOrderDetailResponse> filterList(FilterInvMAOrderDetailRequest filterInvMAOrderDetailRequest);
|
||||
|
||||
/**
|
||||
* 根据养护记录号和条码查询养护记录详情
|
||||
*
|
||||
* @param orderIdFk
|
||||
* @param code
|
||||
* @return
|
||||
*/
|
||||
InvMaintenanceOrderDetailEntity selectByOrderIdAndCode(@Param("orderIdFk") String orderIdFk, @Param("code") String code);
|
||||
|
||||
/**
|
||||
* 查询养护记录详情
|
||||
*
|
||||
* @param orderId
|
||||
* @return
|
||||
*/
|
||||
List<InvMaintenanceOrderDetailEntity> selectByOrderId(@Param("orderId") String orderId);
|
||||
|
||||
/**
|
||||
* 更新养护记录详情时间
|
||||
*
|
||||
* @param id 养护记录详情ID
|
||||
* @param createTime 养护时间
|
||||
* @param updateTime 更新时间
|
||||
* @return
|
||||
*/
|
||||
int updateTime(@Param("id") Integer id, @Param("createTime") String createTime, @Param("updateTime") String updateTime);
|
||||
|
||||
/**
|
||||
* 查询库存养护记录详情ID集合
|
||||
*
|
||||
* @param orderId
|
||||
* @return
|
||||
*/
|
||||
List<Integer> selectDetailIds(@Param("orderId") String orderId);
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
package com.glxp.api.admin.entity.info;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
public class DbVersionEntity {
|
||||
|
||||
private String id;
|
||||
private String version;
|
||||
private String remark;
|
||||
private Date created;
|
||||
|
||||
}
|
@ -0,0 +1,22 @@
|
||||
package com.glxp.api.admin.entity.info;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
|
||||
@Data
|
||||
public class SchemaData {
|
||||
/**
|
||||
* 版本号
|
||||
*/
|
||||
public String version;
|
||||
|
||||
/**
|
||||
* 文件名
|
||||
*/
|
||||
public String fileName;
|
||||
|
||||
public SchemaData(String version, String fileName) {
|
||||
this.version = version;
|
||||
this.fileName = fileName;
|
||||
}
|
||||
}
|
@ -0,0 +1,99 @@
|
||||
package com.glxp.api.admin.entity.inventory;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 设备领用记录详情
|
||||
*/
|
||||
@Data
|
||||
public class DeviceCollectOrderDetailEntity {
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
private Integer id;
|
||||
|
||||
/**
|
||||
* 设备领用记录号
|
||||
*/
|
||||
private String orderIdFk;
|
||||
|
||||
/**
|
||||
* 原始码
|
||||
*/
|
||||
private String originCode;
|
||||
|
||||
/**
|
||||
* 码
|
||||
*/
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* 产品ID
|
||||
*/
|
||||
private String productId;
|
||||
|
||||
/**
|
||||
* 产品DI
|
||||
*/
|
||||
private String nameCode;
|
||||
|
||||
/**
|
||||
* 批次号
|
||||
*/
|
||||
private String batchNo;
|
||||
|
||||
/**
|
||||
* 生产日期
|
||||
*/
|
||||
private String produceDate;
|
||||
|
||||
/**
|
||||
* 失效日期
|
||||
*/
|
||||
private String expireDate;
|
||||
|
||||
/**
|
||||
* 序列号
|
||||
*/
|
||||
private String serialNo;
|
||||
|
||||
/**
|
||||
* 领用时间
|
||||
*/
|
||||
private String createTime;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
private String updateTime;
|
||||
|
||||
/**
|
||||
* 领用仓库
|
||||
*/
|
||||
private String invStorageCode;
|
||||
|
||||
/**
|
||||
* 领用分库
|
||||
*/
|
||||
private String invWarehouseCode;
|
||||
|
||||
/**
|
||||
* 领用货位
|
||||
*/
|
||||
private String invSpaceCode;
|
||||
|
||||
/**
|
||||
* 接收仓库
|
||||
*/
|
||||
private String receiveStorageCode;
|
||||
|
||||
/**
|
||||
* 接收分库
|
||||
*/
|
||||
private String receiveWarehouseCode;
|
||||
|
||||
/**
|
||||
* 接收货位
|
||||
*/
|
||||
private String receiveSpaceCode;
|
||||
}
|
@ -0,0 +1,43 @@
|
||||
package com.glxp.api.admin.req.inventory;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 添加设备领用记录详情参数
|
||||
*/
|
||||
@Data
|
||||
public class AddDeviceCollectOrderDetailRequest {
|
||||
|
||||
/**
|
||||
* 领用记录号
|
||||
*/
|
||||
private String orderIdFk;
|
||||
|
||||
/**
|
||||
* 扫描条码内容
|
||||
*/
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* 产品库存ID集合
|
||||
*/
|
||||
private List<String> invProductIds;
|
||||
|
||||
/**
|
||||
* 仓库码
|
||||
*/
|
||||
private String invStorageCode;
|
||||
|
||||
/**
|
||||
* 货位码
|
||||
*/
|
||||
private String invWarehouseCode;
|
||||
|
||||
/**
|
||||
* 货位码
|
||||
*/
|
||||
private String invSpaceCode;
|
||||
|
||||
}
|
@ -0,0 +1,23 @@
|
||||
package com.glxp.api.admin.req.inventory;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 添加库粗养护记录详情接口参数
|
||||
*/
|
||||
@Data
|
||||
public class AddMAOrderDetailRequest {
|
||||
|
||||
/**
|
||||
* 库存养护记录号
|
||||
*/
|
||||
private String orderIdFk;
|
||||
|
||||
/**
|
||||
* 库存详情ID集合
|
||||
*/
|
||||
List<String> invProductIds;
|
||||
|
||||
}
|
@ -0,0 +1,27 @@
|
||||
package com.glxp.api.admin.req.inventory;
|
||||
|
||||
import com.glxp.api.admin.req.ListPageRequest;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 设备领用记录详情接口参数
|
||||
*/
|
||||
@Data
|
||||
public class FilterDeviceCollectOrderDetailRequest extends ListPageRequest {
|
||||
|
||||
/**
|
||||
* 设备领用记录详情ID
|
||||
*/
|
||||
private Integer id;
|
||||
|
||||
/**
|
||||
* 设备领用记录号
|
||||
*/
|
||||
private String orderIdFk;
|
||||
|
||||
/**
|
||||
* 码
|
||||
*/
|
||||
private String code;
|
||||
|
||||
}
|
@ -0,0 +1,17 @@
|
||||
package com.glxp.api.admin.req.inventory;
|
||||
|
||||
import com.glxp.api.admin.req.ListPageRequest;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 设备养护记录详情查询接口参数
|
||||
*/
|
||||
@Data
|
||||
public class FilterDeviceMAOrderDetailRequest extends ListPageRequest {
|
||||
|
||||
/**
|
||||
* 设备养护记录号
|
||||
*/
|
||||
private String orderIdFk;
|
||||
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
package com.glxp.api.admin.req.inventory;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 盘点单据打印参数
|
||||
*/
|
||||
@Data
|
||||
public class InvCountOrderPrintRequest {
|
||||
|
||||
/**
|
||||
* 盘点单号
|
||||
*/
|
||||
private String orderId;
|
||||
|
||||
/**
|
||||
* 模板ID
|
||||
*/
|
||||
private String templateId;
|
||||
|
||||
}
|
@ -0,0 +1,52 @@
|
||||
package com.glxp.api.admin.res.inventory;
|
||||
|
||||
import com.glxp.api.admin.entity.inventory.DeviceCollectOrderDetailEntity;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 设备领用记录详情响应结果
|
||||
*/
|
||||
@Data
|
||||
public class DeviceCollectOrderDetailResponse extends DeviceCollectOrderDetailEntity {
|
||||
|
||||
/**
|
||||
* 产品名称
|
||||
*/
|
||||
private String productName;
|
||||
|
||||
/**
|
||||
* 分库名称
|
||||
*/
|
||||
private String invWarehouseName;
|
||||
|
||||
/**
|
||||
* 货位名称
|
||||
*/
|
||||
private String invSpaceName;
|
||||
|
||||
/**
|
||||
* 货位名称
|
||||
*/
|
||||
private String invSpaceCode;
|
||||
|
||||
/**
|
||||
* 注册/备案凭证号
|
||||
*/
|
||||
private String zczbhhzbapzbh;
|
||||
|
||||
/**
|
||||
* 生产厂家
|
||||
*/
|
||||
private String ylqxzcrbarmc;
|
||||
|
||||
/**
|
||||
* 规格型号
|
||||
*/
|
||||
private String ggxh;
|
||||
|
||||
/**
|
||||
* 是否可以自定义序列号
|
||||
*/
|
||||
private Boolean editSerialNo;
|
||||
|
||||
}
|
@ -0,0 +1,17 @@
|
||||
package com.glxp.api.admin.res.inventory;
|
||||
|
||||
import com.glxp.api.admin.entity.inventory.DeviceCollectOrderEntity;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 设备领用记录响应结果
|
||||
*/
|
||||
@Data
|
||||
public class DeviceCollectOrderResponse extends DeviceCollectOrderEntity {
|
||||
|
||||
/**
|
||||
* 领用部门
|
||||
*/
|
||||
private String deptName;
|
||||
|
||||
}
|
@ -0,0 +1,32 @@
|
||||
package com.glxp.api.admin.res.inventory;
|
||||
|
||||
import com.glxp.api.admin.entity.inventory.DeviceMAOrderDetailEntity;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 设备养护记录详情响应结果
|
||||
*/
|
||||
@Data
|
||||
public class DeviceMAOrderDetailResponse extends DeviceMAOrderDetailEntity {
|
||||
|
||||
/**
|
||||
* 产品名称
|
||||
*/
|
||||
private String productName;
|
||||
|
||||
/**
|
||||
* 医疗器械注册人名称
|
||||
*/
|
||||
private String ylqxzcrbarmc;
|
||||
|
||||
/**
|
||||
* 注册证备案号
|
||||
*/
|
||||
private String zczbhhzbapzbh;
|
||||
|
||||
/**
|
||||
* 规格型号
|
||||
*/
|
||||
private String ggxh;
|
||||
|
||||
}
|
@ -0,0 +1,32 @@
|
||||
package com.glxp.api.admin.res.inventory;
|
||||
|
||||
import com.glxp.api.admin.entity.inventory.InvMaintenanceOrderDetailEntity;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 养护记录详情接口结果封装类
|
||||
*/
|
||||
@Data
|
||||
public class InvMAOrderDetailResponse extends InvMaintenanceOrderDetailEntity {
|
||||
|
||||
/**
|
||||
* 产品名称
|
||||
*/
|
||||
private String productName;
|
||||
|
||||
/**
|
||||
* 规格型号
|
||||
*/
|
||||
private String ggxh;
|
||||
|
||||
/**
|
||||
* 注册/备案凭证号
|
||||
*/
|
||||
private String zczbhhzbapzbh;
|
||||
|
||||
/**
|
||||
* 生产厂家
|
||||
*/
|
||||
private String ylqxzcrbarmc;
|
||||
|
||||
}
|
@ -0,0 +1,22 @@
|
||||
package com.glxp.api.admin.res.inventory;
|
||||
|
||||
import com.glxp.api.admin.entity.inventory.InvMaintenanceOrderEntity;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 养护记录接口返回结果
|
||||
*/
|
||||
@Data
|
||||
public class InvMAOrderResponse extends InvMaintenanceOrderEntity {
|
||||
|
||||
/**
|
||||
* 分库名称
|
||||
*/
|
||||
private String invWarehouseName;
|
||||
|
||||
/**
|
||||
* 货位名称
|
||||
*/
|
||||
private String invSpaceName;
|
||||
|
||||
}
|
@ -0,0 +1,43 @@
|
||||
package com.glxp.api.admin.res.inventory;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class MAInvProductResponse {
|
||||
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 产品标识
|
||||
*/
|
||||
private String nameCode;
|
||||
|
||||
/**
|
||||
* 产品名称
|
||||
*/
|
||||
private String cpmctymc;
|
||||
|
||||
/**
|
||||
* 规格型号
|
||||
*/
|
||||
private String ggxh;
|
||||
|
||||
/**
|
||||
* 批次号
|
||||
*/
|
||||
private String batchNo;
|
||||
|
||||
/**
|
||||
* 生产日期
|
||||
*/
|
||||
private String productionDate;
|
||||
|
||||
/**
|
||||
* 失效日期
|
||||
*/
|
||||
private String expireDate;
|
||||
|
||||
}
|
@ -0,0 +1,55 @@
|
||||
package com.glxp.api.admin.service.inventory;
|
||||
|
||||
import com.glxp.api.admin.entity.inventory.DeviceCollectOrderDetailEntity;
|
||||
import com.glxp.api.admin.req.inventory.AddDeviceCollectOrderDetailRequest;
|
||||
import com.glxp.api.admin.req.inventory.FilterDeviceCollectOrderDetailRequest;
|
||||
import com.glxp.api.admin.res.inventory.DeviceCollectOrderDetailResponse;
|
||||
import com.glxp.api.common.res.BaseResponse;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 设备领用记录详情Service
|
||||
*/
|
||||
public interface DeviceCollectOrderDetailService {
|
||||
|
||||
/**
|
||||
* 查询设备领用记录详情列表
|
||||
*
|
||||
* @param detailRequest
|
||||
* @return
|
||||
*/
|
||||
List<DeviceCollectOrderDetailResponse> filterList(FilterDeviceCollectOrderDetailRequest detailRequest);
|
||||
|
||||
/**
|
||||
* 添加设备领用记录详情
|
||||
*
|
||||
* @param addDetailRequest
|
||||
* @return
|
||||
*/
|
||||
BaseResponse addOrderDetail(AddDeviceCollectOrderDetailRequest addDetailRequest);
|
||||
|
||||
/**
|
||||
* 更新设备领用记录详情
|
||||
*
|
||||
* @param detailEntity
|
||||
* @return
|
||||
*/
|
||||
BaseResponse updateOrderDetail(DeviceCollectOrderDetailEntity detailEntity);
|
||||
|
||||
/**
|
||||
* 删除设备领用记录详情
|
||||
*
|
||||
* @param detailRequest
|
||||
* @return
|
||||
*/
|
||||
BaseResponse deleteOrderDetail(FilterDeviceCollectOrderDetailRequest detailRequest);
|
||||
|
||||
/**
|
||||
* 添加设备领用详情校验码
|
||||
*
|
||||
* @param code
|
||||
* @return
|
||||
*/
|
||||
BaseResponse checkCode(String code);
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
package com.glxp.api.admin.service.inventory;
|
||||
|
||||
import com.glxp.api.admin.entity.inventory.DeviceCollectOrderEntity;
|
||||
import com.glxp.api.admin.req.inventory.FilterDeviceCollectOrderRequest;
|
||||
import com.glxp.api.admin.res.inventory.DeviceCollectOrderResponse;
|
||||
import com.glxp.api.common.res.BaseResponse;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface DeviceCollectOrderService {
|
||||
|
||||
/**
|
||||
* 查询设备领用记录列表
|
||||
*
|
||||
* @param deviceCollectOrderRequest
|
||||
* @return
|
||||
*/
|
||||
List<DeviceCollectOrderResponse> filterList(FilterDeviceCollectOrderRequest deviceCollectOrderRequest);
|
||||
|
||||
/**
|
||||
* 新增设备领用记录
|
||||
*
|
||||
* @param deviceCollectOrderEntity
|
||||
* @return
|
||||
*/
|
||||
BaseResponse addDeviceCollectOrder(DeviceCollectOrderEntity deviceCollectOrderEntity);
|
||||
|
||||
/**
|
||||
* 更新设备领用记录
|
||||
*
|
||||
* @param deviceCollectOrderEntity
|
||||
* @return
|
||||
*/
|
||||
BaseResponse updateDeviceCollectOrder(DeviceCollectOrderEntity deviceCollectOrderEntity);
|
||||
|
||||
/**
|
||||
* 设备领用记录提交审核
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
BaseResponse submitAudit(Integer id);
|
||||
|
||||
/**
|
||||
* 更新设备领用记录状态
|
||||
*
|
||||
* @param id
|
||||
* @param status
|
||||
* @return
|
||||
*/
|
||||
BaseResponse updateStatus(Integer id, Integer status);
|
||||
|
||||
/**
|
||||
* 删除设备领用记录
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
BaseResponse deleteDeviceCollectOrder(Integer id);
|
||||
|
||||
}
|
@ -0,0 +1,24 @@
|
||||
package com.glxp.api.admin.service.inventory;
|
||||
|
||||
import com.glxp.api.admin.entity.inventory.DeviceMAOrderDetailEntity;
|
||||
import com.glxp.api.admin.req.inventory.FilterDeviceMAOrderDetailRequest;
|
||||
import com.glxp.api.admin.res.inventory.DeviceMAOrderDetailResponse;
|
||||
import com.glxp.api.common.res.BaseResponse;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 设备养护记录详情Service
|
||||
*/
|
||||
public interface DeviceMAOrderDetailService {
|
||||
|
||||
List<DeviceMAOrderDetailResponse> filterList(FilterDeviceMAOrderDetailRequest detailRequest);
|
||||
|
||||
BaseResponse addDetail(DeviceMAOrderDetailEntity detailEntity);
|
||||
|
||||
BaseResponse updateDetail(DeviceMAOrderDetailEntity detailEntity);
|
||||
|
||||
|
||||
BaseResponse deleteDetail(DeviceMAOrderDetailEntity detailEntity);
|
||||
|
||||
}
|
@ -0,0 +1,46 @@
|
||||
package com.glxp.api.admin.service.inventory;
|
||||
|
||||
import com.glxp.api.admin.entity.inventory.DeviceMAOrderEntity;
|
||||
import com.glxp.api.admin.req.inventory.FilterDeviceMAOrderRequest;
|
||||
import com.glxp.api.common.res.BaseResponse;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 设备养护记录Service
|
||||
*/
|
||||
public interface DeviceMAOrderService {
|
||||
|
||||
/**
|
||||
* 查询设备养护记录列表
|
||||
*
|
||||
* @param filterDeviceMAOrderRequest
|
||||
* @return
|
||||
*/
|
||||
List<DeviceMAOrderEntity> filterList(FilterDeviceMAOrderRequest filterDeviceMAOrderRequest);
|
||||
|
||||
/**
|
||||
* 添加设备养护记录
|
||||
*
|
||||
* @param deviceMAOrderEntity
|
||||
* @return
|
||||
*/
|
||||
BaseResponse addDeviceMAOrder(DeviceMAOrderEntity deviceMAOrderEntity);
|
||||
|
||||
/**
|
||||
* 更新设备养护记录
|
||||
*
|
||||
* @param deviceMAOrderEntity
|
||||
* @return
|
||||
*/
|
||||
BaseResponse updateDeviceMAOrder(DeviceMAOrderEntity deviceMAOrderEntity);
|
||||
|
||||
/**
|
||||
* 删除设备养护记录
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
BaseResponse deleteDeviceMAOrder(Integer id);
|
||||
|
||||
}
|
@ -0,0 +1,56 @@
|
||||
package com.glxp.api.admin.service.inventory;
|
||||
|
||||
import com.glxp.api.admin.entity.inventory.InvMaintenanceOrderDetailEntity;
|
||||
import com.glxp.api.admin.req.inventory.AddMAOrderDetailRequest;
|
||||
import com.glxp.api.admin.req.inventory.FilterInvMAOrderDetailRequest;
|
||||
import com.glxp.api.admin.res.inventory.InvMAOrderDetailResponse;
|
||||
import com.glxp.api.common.res.BaseResponse;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 库存养护记录详情Service
|
||||
*/
|
||||
public interface InvMAOrderDetailService {
|
||||
|
||||
/**
|
||||
* 查询养护记录详情
|
||||
*
|
||||
* @param filterInvMAOrderDetailRequest
|
||||
* @return
|
||||
*/
|
||||
List<InvMAOrderDetailResponse> filterList(FilterInvMAOrderDetailRequest filterInvMAOrderDetailRequest);
|
||||
|
||||
/**
|
||||
* 扫码添加养护记录详情
|
||||
*
|
||||
* @param invMaintenanceOrderDetailEntity
|
||||
* @return
|
||||
*/
|
||||
BaseResponse addOrderDetail(InvMaintenanceOrderDetailEntity invMaintenanceOrderDetailEntity);
|
||||
|
||||
/**
|
||||
* 养护详情记录 -1
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
BaseResponse delete(Integer id);
|
||||
|
||||
/**
|
||||
* 根据库存详情批量添加养护详情记录
|
||||
*
|
||||
* @param addMAOrderDetailRequest
|
||||
* @return
|
||||
*/
|
||||
BaseResponse batchAddDetail(AddMAOrderDetailRequest addMAOrderDetailRequest);
|
||||
|
||||
/**
|
||||
* 更新养护记录详情
|
||||
*
|
||||
* @param invMaintenanceOrderDetailEntity
|
||||
* @return
|
||||
*/
|
||||
BaseResponse update(InvMaintenanceOrderDetailEntity invMaintenanceOrderDetailEntity);
|
||||
|
||||
}
|
@ -0,0 +1,64 @@
|
||||
package com.glxp.api.admin.service.inventory;
|
||||
|
||||
import com.glxp.api.admin.entity.inventory.InvMaintenanceOrderEntity;
|
||||
import com.glxp.api.admin.req.inventory.FilterInvMAOrderRequest;
|
||||
import com.glxp.api.admin.res.inventory.InvMAOrderResponse;
|
||||
import com.glxp.api.common.res.BaseResponse;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 库存养护记录Service
|
||||
*/
|
||||
public interface InvMAOrderService {
|
||||
|
||||
/**
|
||||
* 查询养护记录列表
|
||||
*
|
||||
* @param filterInvMAOrderRequest
|
||||
* @return
|
||||
*/
|
||||
List<InvMAOrderResponse> filterList(FilterInvMAOrderRequest filterInvMAOrderRequest);
|
||||
|
||||
/**
|
||||
* 添加养护记录
|
||||
*
|
||||
* @param invMaintenanceOrder
|
||||
* @return
|
||||
*/
|
||||
BaseResponse addOrder(InvMaintenanceOrderEntity invMaintenanceOrder);
|
||||
|
||||
/**
|
||||
* 更新养护记录
|
||||
*
|
||||
* @param invMaintenanceOrder
|
||||
* @return
|
||||
*/
|
||||
BaseResponse update(InvMaintenanceOrderEntity invMaintenanceOrder);
|
||||
|
||||
/**
|
||||
* 养护记录提交审核
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
BaseResponse submitAudit(Integer id);
|
||||
|
||||
/**
|
||||
* 更新养护记录状态
|
||||
*
|
||||
* @param id
|
||||
* @param status
|
||||
* @return
|
||||
*/
|
||||
BaseResponse updateStatus(Integer id, Integer status);
|
||||
|
||||
/**
|
||||
* 删除养护记录
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
BaseResponse delete(@Param("id") Integer id);
|
||||
}
|
@ -0,0 +1,145 @@
|
||||
package com.glxp.api.admin.service.inventory.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.glxp.api.admin.constant.Constant;
|
||||
import com.glxp.api.admin.dao.inventory.DeviceCollectOrderDao;
|
||||
import com.glxp.api.admin.dao.inventory.DeviceCollectOrderDetailDao;
|
||||
import com.glxp.api.admin.entity.inout.WarehouseEntity;
|
||||
import com.glxp.api.admin.entity.inventory.DeviceCollectOrderDetailEntity;
|
||||
import com.glxp.api.admin.entity.inventory.DeviceCollectOrderEntity;
|
||||
import com.glxp.api.admin.req.inventory.FilterDeviceCollectOrderRequest;
|
||||
import com.glxp.api.admin.res.inventory.DeviceCollectOrderResponse;
|
||||
import com.glxp.api.admin.service.auth.CustomerService;
|
||||
import com.glxp.api.admin.service.inventory.DeviceCollectOrderService;
|
||||
import com.glxp.api.admin.util.DateUtil;
|
||||
import com.glxp.api.admin.util.FilterUdiUtils;
|
||||
import com.glxp.api.admin.util.GennerOrderUtils;
|
||||
import com.glxp.api.admin.util.OrderNoTypeBean;
|
||||
import com.glxp.api.common.enums.ResultEnum;
|
||||
import com.glxp.api.common.res.BaseResponse;
|
||||
import com.glxp.api.common.util.ResultVOUtils;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
@Slf4j
|
||||
@Service
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public class DeviceCollectOrderServiceImpl implements DeviceCollectOrderService {
|
||||
|
||||
@Resource
|
||||
private DeviceCollectOrderDao deviceCollectOrderDao;
|
||||
@Resource
|
||||
private DeviceCollectOrderDetailDao deviceCollectOrderDetailDao;
|
||||
@Resource
|
||||
private GennerOrderUtils gennerOrderUtils;
|
||||
@Resource
|
||||
private CustomerService customerService;
|
||||
|
||||
@Override
|
||||
public List<DeviceCollectOrderResponse> filterList(FilterDeviceCollectOrderRequest deviceCollectOrderRequest) {
|
||||
if (null == deviceCollectOrderRequest) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
if (null != deviceCollectOrderRequest.getPage() && null != deviceCollectOrderRequest.getLimit()) {
|
||||
PageHelper.offsetPage((deviceCollectOrderRequest.getPage() - 1) * deviceCollectOrderRequest.getLimit(), deviceCollectOrderRequest.getLimit());
|
||||
}
|
||||
return deviceCollectOrderDao.filterList(deviceCollectOrderRequest);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BaseResponse addDeviceCollectOrder(DeviceCollectOrderEntity deviceCollectOrderEntity) {
|
||||
if (null == deviceCollectOrderEntity) {
|
||||
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL);
|
||||
}
|
||||
//生成单号
|
||||
String orderId = gennerOrderUtils.createStOrderNo(new OrderNoTypeBean(Constant.DEVICE_COLLECT_ORDER, "yyyyMMdd"));
|
||||
deviceCollectOrderEntity.setOrderId(orderId);
|
||||
deviceCollectOrderEntity.setCreateTime(DateUtil.getDateTime());
|
||||
deviceCollectOrderEntity.setStatus(0);
|
||||
deviceCollectOrderEntity.setUpdateTime(DateUtil.getDateTime());
|
||||
String userName = customerService.getUserBean().getUserName();
|
||||
deviceCollectOrderEntity.setCreateUser(userName);
|
||||
deviceCollectOrderDao.insert(deviceCollectOrderEntity);
|
||||
return ResultVOUtils.success(deviceCollectOrderEntity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BaseResponse updateDeviceCollectOrder(DeviceCollectOrderEntity deviceCollectOrderEntity) {
|
||||
if (null == deviceCollectOrderEntity || null == deviceCollectOrderEntity.getId() || StrUtil.isBlank(deviceCollectOrderEntity.getOrderId())) {
|
||||
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL);
|
||||
}
|
||||
deviceCollectOrderEntity.setUpdateTime(DateUtil.getDateTime());
|
||||
deviceCollectOrderDao.updateByPrimaryKey(deviceCollectOrderEntity);
|
||||
return ResultVOUtils.success("更新成功");
|
||||
}
|
||||
|
||||
@Override
|
||||
public BaseResponse submitAudit(Integer id) {
|
||||
if (null == id) {
|
||||
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL);
|
||||
}
|
||||
//查询设备领用记录详情,判断是否每个设备都可以分辨唯一,如果不能,则无法提交审核
|
||||
String orderId = deviceCollectOrderDao.selectOrderIdById(id);
|
||||
if (StrUtil.isBlank(orderId)) {
|
||||
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, "领用记录不存在!");
|
||||
}
|
||||
List<DeviceCollectOrderDetailEntity> detailList = deviceCollectOrderDetailDao.selectByOrderId(orderId);
|
||||
if (CollUtil.isEmpty(detailList)) {
|
||||
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, "请添加领用设备!");
|
||||
}
|
||||
for (DeviceCollectOrderDetailEntity deviceCollectOrderDetailEntity : detailList) {
|
||||
if (StrUtil.isBlank(deviceCollectOrderDetailEntity.getSerialNo())) {
|
||||
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, "领用设备中存在无序列号设备,无法提交审核,请完善设备信息!");
|
||||
}
|
||||
}
|
||||
//更新领用记录状态为待审核
|
||||
deviceCollectOrderDao.updateStatusById(1, id);
|
||||
return ResultVOUtils.success("提交成功!");
|
||||
}
|
||||
|
||||
@Override
|
||||
public BaseResponse updateStatus(Integer id, Integer status) {
|
||||
if (null == id || null == status) {
|
||||
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, "");
|
||||
}
|
||||
DeviceCollectOrderEntity deviceCollectOrderEntity = deviceCollectOrderDao.selectByPrimaryKey(id);
|
||||
if (null == deviceCollectOrderEntity) {
|
||||
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, "领用记录不出存在!");
|
||||
}
|
||||
//查询此领用记录详情中定义序列号的记录,重新生成码
|
||||
List<DeviceCollectOrderDetailEntity> detailEntityList = deviceCollectOrderDetailDao.selectByOrderId(deviceCollectOrderEntity.getOrderId());
|
||||
detailEntityList.forEach(detailEntity -> {
|
||||
if (StrUtil.isBlank(detailEntity.getCode())) {
|
||||
WarehouseEntity warehouseEntity = new WarehouseEntity();
|
||||
BeanUtil.copyProperties(detailEntity, warehouseEntity);
|
||||
String code = FilterUdiUtils.transGlxpHasSerStr(warehouseEntity);
|
||||
detailEntity.setCode(code);
|
||||
//更新详情的条码信息
|
||||
deviceCollectOrderDetailDao.updateByPrimaryKey(detailEntity);
|
||||
}
|
||||
});
|
||||
|
||||
String auditUser = customerService.getUserBean().getUserName();
|
||||
deviceCollectOrderEntity.setAuditUser(auditUser);
|
||||
deviceCollectOrderEntity.setStatus(status);
|
||||
deviceCollectOrderDao.updateByPrimaryKey(deviceCollectOrderEntity);
|
||||
return ResultVOUtils.success("更新成功!");
|
||||
}
|
||||
|
||||
@Override
|
||||
public BaseResponse deleteDeviceCollectOrder(Integer id) {
|
||||
if (null == id) {
|
||||
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL);
|
||||
}
|
||||
deviceCollectOrderDao.deleteByPrimaryKey(id);
|
||||
return ResultVOUtils.success("删除成功!");
|
||||
}
|
||||
}
|
@ -0,0 +1,74 @@
|
||||
package com.glxp.api.admin.service.inventory.impl;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.glxp.api.admin.dao.inventory.DeviceMaOrderDetailDao;
|
||||
import com.glxp.api.admin.entity.inventory.DeviceMAOrderDetailEntity;
|
||||
import com.glxp.api.admin.req.inventory.FilterDeviceMAOrderDetailRequest;
|
||||
import com.glxp.api.admin.res.inventory.DeviceMAOrderDetailResponse;
|
||||
import com.glxp.api.admin.service.inventory.DeviceMAOrderDetailService;
|
||||
import com.glxp.api.common.enums.ResultEnum;
|
||||
import com.glxp.api.common.res.BaseResponse;
|
||||
import com.glxp.api.common.util.ResultVOUtils;
|
||||
import groovy.util.logging.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
@Slf4j
|
||||
@Service
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public class DeviceMAOrderDetailServiceImpl implements DeviceMAOrderDetailService {
|
||||
|
||||
@Resource
|
||||
private DeviceMaOrderDetailDao deviceMaOrderDetailDao;
|
||||
|
||||
@Override
|
||||
public List<DeviceMAOrderDetailResponse> filterList(FilterDeviceMAOrderDetailRequest detailRequest) {
|
||||
if (null == detailRequest) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
if (null != detailRequest.getPage() && null != detailRequest.getLimit()) {
|
||||
PageHelper.offsetPage((detailRequest.getPage() - 1) * detailRequest.getLimit(), detailRequest.getLimit());
|
||||
}
|
||||
return deviceMaOrderDetailDao.filterList(detailRequest);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BaseResponse addDetail(DeviceMAOrderDetailEntity detailEntity) {
|
||||
if (null == detailEntity) {
|
||||
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL);
|
||||
}
|
||||
deviceMaOrderDetailDao.insert(detailEntity);
|
||||
return ResultVOUtils.success("添加成功!");
|
||||
}
|
||||
|
||||
@Override
|
||||
public BaseResponse updateDetail(DeviceMAOrderDetailEntity detailEntity) {
|
||||
if (null == detailEntity || null == detailEntity.getId()) {
|
||||
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL);
|
||||
}
|
||||
deviceMaOrderDetailDao.updateByPrimaryKey(detailEntity);
|
||||
return ResultVOUtils.success("更新成功");
|
||||
}
|
||||
|
||||
@Override
|
||||
public BaseResponse deleteDetail(DeviceMAOrderDetailEntity detailEntity) {
|
||||
if (null == detailEntity) {
|
||||
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL);
|
||||
}
|
||||
if (null == detailEntity.getId() && StrUtil.isBlank(detailEntity.getOrderIdFk())) {
|
||||
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL);
|
||||
}
|
||||
if (null != detailEntity.getId()) {
|
||||
deviceMaOrderDetailDao.deleteByPrimaryKey(detailEntity.getId());
|
||||
} else {
|
||||
//删除整单数据
|
||||
deviceMaOrderDetailDao.deleteByOrderId(detailEntity.getOrderIdFk());
|
||||
}
|
||||
return ResultVOUtils.success("删除成功");
|
||||
}
|
||||
}
|
@ -0,0 +1,127 @@
|
||||
package com.glxp.api.admin.service.inventory.impl;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.glxp.api.admin.constant.Constant;
|
||||
import com.glxp.api.admin.dao.inventory.DeviceCollectOrderDetailDao;
|
||||
import com.glxp.api.admin.dao.inventory.DeviceMAOrderDao;
|
||||
import com.glxp.api.admin.dao.inventory.DeviceMaOrderDetailDao;
|
||||
import com.glxp.api.admin.entity.inventory.DeviceCollectOrderDetailEntity;
|
||||
import com.glxp.api.admin.entity.inventory.DeviceMAOrderDetailEntity;
|
||||
import com.glxp.api.admin.entity.inventory.DeviceMAOrderEntity;
|
||||
import com.glxp.api.admin.req.inventory.FilterDeviceMAOrderRequest;
|
||||
import com.glxp.api.admin.service.auth.CustomerService;
|
||||
import com.glxp.api.admin.service.inventory.DeviceMAOrderService;
|
||||
import com.glxp.api.admin.util.DateUtil;
|
||||
import com.glxp.api.admin.util.GennerOrderUtils;
|
||||
import com.glxp.api.admin.util.OrderNoTypeBean;
|
||||
import com.glxp.api.common.enums.ResultEnum;
|
||||
import com.glxp.api.common.res.BaseResponse;
|
||||
import com.glxp.api.common.util.ResultVOUtils;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
@Slf4j
|
||||
@Service
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public class DeviceMAOrderServiceImpl implements DeviceMAOrderService {
|
||||
|
||||
@Resource
|
||||
private DeviceMAOrderDao deviceMAOrderDao;
|
||||
@Resource
|
||||
private CustomerService customerService;
|
||||
@Resource
|
||||
private GennerOrderUtils gennerOrderUtils;
|
||||
@Resource
|
||||
private DeviceCollectOrderDetailDao deviceCollectOrderDetailDao;
|
||||
@Resource
|
||||
private DeviceMaOrderDetailDao deviceMaOrderDetailDao;
|
||||
|
||||
@Override
|
||||
public List<DeviceMAOrderEntity> filterList(FilterDeviceMAOrderRequest filterDeviceMAOrderRequest) {
|
||||
if (null == filterDeviceMAOrderRequest) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
if (null != filterDeviceMAOrderRequest.getPage() && null != filterDeviceMAOrderRequest.getLimit()) {
|
||||
PageHelper.offsetPage((filterDeviceMAOrderRequest.getPage() - 1) * filterDeviceMAOrderRequest.getLimit(), filterDeviceMAOrderRequest.getLimit());
|
||||
}
|
||||
return deviceMAOrderDao.filterList(filterDeviceMAOrderRequest);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BaseResponse addDeviceMAOrder(DeviceMAOrderEntity deviceMAOrderEntity) {
|
||||
if (null == deviceMAOrderEntity) {
|
||||
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL);
|
||||
}
|
||||
if (StrUtil.isBlank(deviceMAOrderEntity.getCollOrderId())) {
|
||||
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, "请选择养护设备!");
|
||||
}
|
||||
deviceMAOrderEntity.setOrderId(gennerOrderUtils.createStOrderNo(new OrderNoTypeBean(Constant.DEVICE_MA_ORDER, "yyyyMMdd")));
|
||||
deviceMAOrderEntity.setCreateUser(customerService.getUserBean().getUserName());
|
||||
deviceMAOrderEntity.setCreateTime(DateUtil.getDateTime());
|
||||
deviceMAOrderEntity.setStatus(0);
|
||||
deviceMAOrderEntity.setUpdateTime(DateUtil.getDateTime());
|
||||
deviceMAOrderDao.insert(deviceMAOrderEntity);
|
||||
//查询此设备领用单据的设备列表,生成养护清单
|
||||
List<DeviceCollectOrderDetailEntity> deviceCollectOrderDetailList = deviceCollectOrderDetailDao.selectByOrderId(deviceMAOrderEntity.getCollOrderId());
|
||||
deviceCollectOrderDetailList.forEach(collectOrderDetail -> {
|
||||
DeviceMAOrderDetailEntity detailEntity = new DeviceMAOrderDetailEntity();
|
||||
detailEntity.setOrderIdFk(deviceMAOrderEntity.getOrderId());
|
||||
detailEntity.setCode(collectOrderDetail.getCode());
|
||||
detailEntity.setNameCode(collectOrderDetail.getNameCode());
|
||||
detailEntity.setBatchNo(collectOrderDetail.getBatchNo());
|
||||
detailEntity.setProduceDate(collectOrderDetail.getProduceDate());
|
||||
detailEntity.setExpireDate(collectOrderDetail.getExpireDate());
|
||||
detailEntity.setProductId(collectOrderDetail.getProductId());
|
||||
detailEntity.setSerialNo(collectOrderDetail.getSerialNo());
|
||||
detailEntity.setCreateUser(deviceMAOrderEntity.getCreateUser());
|
||||
detailEntity.setCreateTime(deviceMAOrderEntity.getCreateTime());
|
||||
detailEntity.setMaintenanceStatus(0);
|
||||
detailEntity.setDeviceStatus(1);
|
||||
deviceMaOrderDetailDao.insert(detailEntity);
|
||||
});
|
||||
return ResultVOUtils.success(deviceMAOrderEntity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BaseResponse updateDeviceMAOrder(DeviceMAOrderEntity deviceMAOrderEntity) {
|
||||
if (null == deviceMAOrderEntity) {
|
||||
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL);
|
||||
}
|
||||
if (null == deviceMAOrderEntity.getId() || StrUtil.isBlank(deviceMAOrderEntity.getOrderId())) {
|
||||
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL);
|
||||
}
|
||||
if (deviceMAOrderEntity.getStatus() == 1) {
|
||||
//完成养护记录更新,查询此条养护记录详情中是否存在未养护完成设备
|
||||
List<DeviceMAOrderDetailEntity> detailList = deviceMaOrderDetailDao.selectByOrderId(deviceMAOrderEntity.getOrderId());
|
||||
for (DeviceMAOrderDetailEntity deviceMAOrderDetailEntity : detailList) {
|
||||
if (deviceMAOrderDetailEntity.getMaintenanceStatus() == 0) {
|
||||
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, "存在未养护设备,请完成该设备养护!");
|
||||
}
|
||||
}
|
||||
}
|
||||
deviceMAOrderDao.updateByPrimaryKey(deviceMAOrderEntity);
|
||||
return ResultVOUtils.success("更新成功");
|
||||
}
|
||||
|
||||
@Override
|
||||
public BaseResponse deleteDeviceMAOrder(Integer id) {
|
||||
if (null == id) {
|
||||
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL);
|
||||
}
|
||||
DeviceMAOrderEntity deviceMAOrderEntity = deviceMAOrderDao.selectByPrimaryKey(id);
|
||||
if (null == deviceMAOrderEntity) {
|
||||
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, "此记录已被删除!");
|
||||
}
|
||||
deviceMAOrderDao.deleteByPrimaryKey(id);
|
||||
//删除此养护记录的详情数据
|
||||
deviceCollectOrderDetailDao.deleteByOrderId(deviceMAOrderEntity.getOrderId());
|
||||
return ResultVOUtils.success("删除成功!");
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,132 @@
|
||||
package com.glxp.api.admin.service.inventory.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.date.DatePattern;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.glxp.api.admin.constant.Constant;
|
||||
import com.glxp.api.admin.dao.inventory.InvMaintenanceOrderDao;
|
||||
import com.glxp.api.admin.dao.inventory.InvMaintenanceOrderDetailDao;
|
||||
import com.glxp.api.admin.entity.inventory.InvMaintenanceOrderEntity;
|
||||
import com.glxp.api.admin.req.inventory.FilterInvMAOrderRequest;
|
||||
import com.glxp.api.admin.res.inventory.InvMAOrderResponse;
|
||||
import com.glxp.api.admin.service.auth.CustomerService;
|
||||
import com.glxp.api.admin.service.inventory.InvMAOrderService;
|
||||
import com.glxp.api.admin.util.GennerOrderUtils;
|
||||
import com.glxp.api.admin.util.OrderNoTypeBean;
|
||||
import com.glxp.api.common.enums.ResultEnum;
|
||||
import com.glxp.api.common.res.BaseResponse;
|
||||
import com.glxp.api.common.util.ResultVOUtils;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
@Slf4j
|
||||
@Service
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public class InvMAOrderServiceImpl implements InvMAOrderService {
|
||||
|
||||
@Resource
|
||||
private InvMaintenanceOrderDao invMAOrderDao;
|
||||
@Resource
|
||||
private GennerOrderUtils gennerOrderUtils;
|
||||
@Resource
|
||||
private CustomerService customerService;
|
||||
@Resource
|
||||
private InvMaintenanceOrderDetailDao invMAOrderDetailDao;
|
||||
|
||||
|
||||
@Override
|
||||
public List<InvMAOrderResponse> filterList(FilterInvMAOrderRequest filterInvMAOrderRequest) {
|
||||
if (null == filterInvMAOrderRequest) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
if (null != filterInvMAOrderRequest.getPage() && null != filterInvMAOrderRequest.getLimit()) {
|
||||
PageHelper.offsetPage((filterInvMAOrderRequest.getPage() - 1) * filterInvMAOrderRequest.getLimit(), filterInvMAOrderRequest.getLimit());
|
||||
}
|
||||
return invMAOrderDao.filterList(filterInvMAOrderRequest);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BaseResponse addOrder(InvMaintenanceOrderEntity invMaintenanceOrder) {
|
||||
if (null == invMaintenanceOrder || StrUtil.isBlank(invMaintenanceOrder.getInvWarehouseCode())) {
|
||||
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, "参数不能为空!");
|
||||
}
|
||||
//生成养护记录
|
||||
//生成单据号
|
||||
invMaintenanceOrder.setOrderId(gennerOrderUtils.createStOrderNo(new OrderNoTypeBean(Constant.MA_ORDER, "yyyyMMdd")));
|
||||
//创建时间
|
||||
invMaintenanceOrder.setCreateTime(DateUtil.date().toString(DatePattern.NORM_DATETIME_PATTERN));
|
||||
//创建人
|
||||
String createUser = customerService.getUserBean().getUserName();
|
||||
invMaintenanceOrder.setCreateUser(createUser);
|
||||
//设置状态为草稿
|
||||
invMaintenanceOrder.setStatus(0);
|
||||
invMAOrderDao.insert(invMaintenanceOrder);
|
||||
return ResultVOUtils.success(invMaintenanceOrder);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BaseResponse update(InvMaintenanceOrderEntity invMaintenanceOrder) {
|
||||
//查找此单据是否存在
|
||||
InvMaintenanceOrderEntity maintenanceOrder = invMAOrderDao.selectByOrderId(invMaintenanceOrder.getOrderId());
|
||||
if (null == maintenanceOrder) {
|
||||
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, "此单据不存在!");
|
||||
}
|
||||
//复制新数据
|
||||
BeanUtil.copyProperties(invMaintenanceOrder, maintenanceOrder, "id", "createTime", "createUser");
|
||||
invMAOrderDao.updateByPrimaryKey(maintenanceOrder);
|
||||
return ResultVOUtils.success("更新成功");
|
||||
}
|
||||
|
||||
@Override
|
||||
public BaseResponse submitAudit(Integer id) {
|
||||
InvMaintenanceOrderEntity maintenanceOrder = invMAOrderDao.selectByPrimaryKey(id);
|
||||
if (null == maintenanceOrder) {
|
||||
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, "此记录不存在!");
|
||||
}
|
||||
if (maintenanceOrder.getStatus() != 0) {
|
||||
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, "此记录已提交审核,请勿重复提交!");
|
||||
}
|
||||
//查询此养护记录是否添加详情
|
||||
Long count = invMAOrderDetailDao.countByOrderId(maintenanceOrder.getOrderId());
|
||||
if (count == 0) {
|
||||
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, "请添加养护产品!");
|
||||
}
|
||||
maintenanceOrder.setStatus(1);
|
||||
maintenanceOrder.setUpdateTime(DateUtil.date().toString(DatePattern.NORM_DATETIME_PATTERN));
|
||||
invMAOrderDao.updateByPrimaryKey(maintenanceOrder);
|
||||
return ResultVOUtils.success("提交成功");
|
||||
}
|
||||
|
||||
@Override
|
||||
public BaseResponse updateStatus(Integer id, Integer status) {
|
||||
InvMaintenanceOrderEntity maintenanceOrder = invMAOrderDao.selectByPrimaryKey(id);
|
||||
if (null == maintenanceOrder || maintenanceOrder.getStatus() != 1) {
|
||||
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL);
|
||||
}
|
||||
maintenanceOrder.setStatus(status);
|
||||
maintenanceOrder.setAuditTime(DateUtil.date().toString(DatePattern.NORM_DATETIME_PATTERN));
|
||||
maintenanceOrder.setUpdateTime(DateUtil.date().toString(DatePattern.NORM_DATETIME_PATTERN));
|
||||
invMAOrderDao.updateByPrimaryKey(maintenanceOrder);
|
||||
return ResultVOUtils.success("更新成功");
|
||||
}
|
||||
|
||||
@Override
|
||||
public BaseResponse delete(Integer id) {
|
||||
InvMaintenanceOrderEntity maintenanceOrder = invMAOrderDao.selectByPrimaryKey(id);
|
||||
if (null == maintenanceOrder) {
|
||||
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, "此记录不存在!");
|
||||
}
|
||||
//删除养护记录和详情
|
||||
invMAOrderDao.deleteByPrimaryKey(id);
|
||||
invMAOrderDetailDao.deleteByOrderId(maintenanceOrder.getOrderId());
|
||||
return ResultVOUtils.success("删除成功");
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,26 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||
|
||||
<mapper namespace="com.glxp.api.admin.dao.info.DbVersionDao">
|
||||
|
||||
|
||||
<select id="selectVersion" resultType="int">
|
||||
selecT count(1)
|
||||
from db_version
|
||||
where version = #{version}
|
||||
</select>
|
||||
|
||||
<select id="selectTableExist" resultType="int">
|
||||
select count(*) count
|
||||
from information_schema.TABLES
|
||||
where TABLE_NAME = #{tableName} and table_schema = (select database())
|
||||
|
||||
</select>
|
||||
|
||||
<insert id="insertVersion">
|
||||
insert into db_version(id, version, remark, created)
|
||||
values (uuid(), #{version}, #{remark}, #{created})
|
||||
</insert>
|
||||
|
||||
|
||||
</mapper>
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue