1.调整设备养护功能

zhairh
x_z 2 years ago
parent 2fee84c091
commit 27c5f093c2

@ -112,4 +112,20 @@ public class DeviceCollectDetailController {
return detailService.deleteOrderDetail(detailRequest);
}
/**
*
*
* @param detailRequest
* @return
*/
@GetMapping("/device/collect/order/detail/deviceList")
public BaseResponse deviceList(FilterDeviceCollectOrderDetailRequest detailRequest) {
List<DeviceCollectOrderDetailResponse> list = detailService.getDeviceList(detailRequest);
PageInfo<DeviceCollectOrderDetailResponse> pageInfo = new PageInfo<>(list);
PageSimpleResponse<DeviceCollectOrderDetailResponse> pageSimpleResponse = new PageSimpleResponse<>();
pageSimpleResponse.setList(list);
pageSimpleResponse.setTotal(pageInfo.getTotal());
return ResultVOUtils.success(pageSimpleResponse);
}
}

@ -2,6 +2,7 @@ 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.AddDeviceMAOrderRequest;
import com.glxp.api.admin.req.inventory.FilterDeviceMAOrderRequest;
import com.glxp.api.admin.res.PageSimpleResponse;
import com.glxp.api.admin.service.inventory.DeviceMAOrderService;
@ -92,5 +93,20 @@ public class DeviceMAOrderController {
return deviceMAOrderService.deleteDeviceMAOrder(filterDeviceMAOrderRequest.getId());
}
/**
*
*
* @param addDeviceMAOrderRequest
* @param bindingResult
* @return
*/
@PostMapping("/device/MA/order/addDeviceMAOrder")
public BaseResponse addDeviceMAOrder(@RequestBody AddDeviceMAOrderRequest addDeviceMAOrderRequest, BindingResult bindingResult) {
if (bindingResult.hasErrors()) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
}
return deviceMAOrderService.addDeviceMAOrder(addDeviceMAOrderRequest);
}
}

@ -1,5 +1,6 @@
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.DeviceMAOrderDetailEntity;
import com.glxp.api.admin.req.inventory.FilterDeviceMAOrderDetailRequest;
@ -88,4 +89,18 @@ public class DeviceMAOrderDetailCotroller {
return deviceMAOrderDetailService.deleteDetail(detailEntity);
}
/**
*
*
* @param code
* @return
*/
@GetMapping("/device/MA/order/detail/filterMAOrderDetail")
public BaseResponse filterMAOrderDetail(String code) {
if (StrUtil.isBlank(code)) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL);
}
return deviceMAOrderDetailService.filterMAOrderDetail(code);
}
}

@ -3,10 +3,12 @@ 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.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@Mapper
public interface DeviceCollectOrderDao {
int deleteByPrimaryKey(Integer id);

@ -3,10 +3,12 @@ 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.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@Mapper
public interface DeviceCollectOrderDetailDao {
int deleteByPrimaryKey(Integer id);
@ -45,4 +47,19 @@ public interface DeviceCollectOrderDetailDao {
*/
List<DeviceCollectOrderDetailEntity> selectList(FilterDeviceCollectOrderDetailRequest filterDeviceCollectOrderDetailRequest);
/**
*
*
* @param detailRequest
* @return
*/
List<DeviceCollectOrderDetailResponse> selectDeviceList(FilterDeviceCollectOrderDetailRequest detailRequest);
/**
*
*
* @param code
* @return
*/
DeviceCollectOrderDetailEntity findOneByCode(@Param("code") String code);
}

@ -3,10 +3,13 @@ package com.glxp.api.admin.dao.inventory;
import com.glxp.api.admin.entity.inventory.DeviceMAOrderEntity;
import com.glxp.api.admin.req.inventory.FilterDeviceMAOrderRequest;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
@Mapper
public interface DeviceMAOrderDao {
int deleteByPrimaryKey(Integer id);
int insert(DeviceMAOrderEntity record);

@ -3,11 +3,14 @@ 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.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@Mapper
public interface DeviceMaOrderDetailDao {
int deleteByPrimaryKey(Integer id);
int insert(DeviceMAOrderDetailEntity record);
@ -31,4 +34,12 @@ public interface DeviceMaOrderDetailDao {
* @return
*/
List<DeviceMAOrderDetailEntity> selectByOrderId(@Param("orderId") String orderId);
/**
*
*
* @param productId
* @return
*/
DeviceMAOrderDetailResponse filterMAOrderDetail(String productId);
}

@ -1,10 +1,12 @@
package com.glxp.api.admin.dao.inventory;
import com.glxp.api.admin.entity.inventory.InvMaintenanceExplanationEntity;
import org.apache.ibatis.annotations.Mapper;
/**
* Dao
*/
@Mapper
public interface InvMaintenanceExplanationDao {
InvMaintenanceExplanationEntity selectByStatus(Integer status);

@ -3,10 +3,12 @@ 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.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@Mapper
public interface InvMaintenanceOrderDao {
int deleteByPrimaryKey(Integer id);

@ -3,10 +3,12 @@ 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.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@Mapper
public interface InvMaintenanceOrderDetailDao {
int deleteByPrimaryKey(Integer id);

@ -0,0 +1,45 @@
package com.glxp.api.admin.req.inventory;
import lombok.Data;
/**
*
*/
@Data
public class AddDeviceMAOrderRequest {
/**
*
*/
private String code;
/**
*
*/
private String createUser;
/**
*
*/
private String deptCode;
/**
*
*/
private String createTime;
/**
*
*/
private Integer maintenanceStatus;
/**
*
*/
private Integer deviceStatus;
/**
*
*/
private String remark;
}

@ -24,4 +24,19 @@ public class FilterDeviceCollectOrderDetailRequest extends ListPageRequest {
*/
private String code;
/**
* DI
*/
private String nameCode;
/**
*
*/
private String deptCode;
/**
*
*/
private String collectUser;
}

@ -49,4 +49,9 @@ public class DeviceCollectOrderDetailResponse extends DeviceCollectOrderDetailEn
*/
private Boolean editSerialNo;
/**
*
*/
private String deptName;
}

@ -52,4 +52,12 @@ public interface DeviceCollectOrderDetailService {
* @return
*/
BaseResponse checkCode(String code);
/**
*
*
* @param detailRequest
* @return
*/
List<DeviceCollectOrderDetailResponse> getDeviceList(FilterDeviceCollectOrderDetailRequest detailRequest);
}

@ -21,4 +21,11 @@ public interface DeviceMAOrderDetailService {
BaseResponse deleteDetail(DeviceMAOrderDetailEntity detailEntity);
/**
*
*
* @param code
* @return
*/
BaseResponse filterMAOrderDetail(String code);
}

@ -1,6 +1,7 @@
package com.glxp.api.admin.service.inventory;
import com.glxp.api.admin.entity.inventory.DeviceMAOrderEntity;
import com.glxp.api.admin.req.inventory.AddDeviceMAOrderRequest;
import com.glxp.api.admin.req.inventory.FilterDeviceMAOrderRequest;
import com.glxp.api.common.res.BaseResponse;
@ -43,4 +44,11 @@ public interface DeviceMAOrderService {
*/
BaseResponse deleteDeviceMAOrder(Integer id);
/**
*
*
* @param addDeviceMAOrderRequest
* @return
*/
BaseResponse addDeviceMAOrder(AddDeviceMAOrderRequest addDeviceMAOrderRequest);
}

@ -57,7 +57,7 @@ public class DeviceCollectOrderDetailServiceImpl implements DeviceCollectOrderDe
List<DeviceCollectOrderDetailResponse> list = deviceCollectOrderDetailDao.filterList(detailRequest);
//设置是否可以自定义序列号标识
list.forEach(item -> {
item.setEditSerialNo(StrUtil.isBlank(item.getCode()) ? true : false);
item.setEditSerialNo(StrUtil.isBlank(item.getCode()));
});
return list;
}
@ -244,4 +244,16 @@ public class DeviceCollectOrderDetailServiceImpl implements DeviceCollectOrderDe
}
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, "此条码在库存中不存在,无法领用!");
}
@Override
public List<DeviceCollectOrderDetailResponse> getDeviceList(FilterDeviceCollectOrderDetailRequest detailRequest) {
if (null == detailRequest) {
return Collections.emptyList();
}
if (null != detailRequest.getPage() && null != detailRequest.getLimit()) {
PageHelper.offsetPage((detailRequest.getPage() - 1) * detailRequest.getLimit(), detailRequest.getLimit());
}
return deviceCollectOrderDetailDao.selectDeviceList(detailRequest);
}
}

@ -2,7 +2,9 @@ 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.DeviceCollectOrderDetailDao;
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.req.inventory.FilterDeviceMAOrderDetailRequest;
import com.glxp.api.admin.res.inventory.DeviceMAOrderDetailResponse;
@ -25,6 +27,8 @@ public class DeviceMAOrderDetailServiceImpl implements DeviceMAOrderDetailServic
@Resource
private DeviceMaOrderDetailDao deviceMaOrderDetailDao;
@Resource
private DeviceCollectOrderDetailDao deviceCollectOrderDetailDao;
@Override
public List<DeviceMAOrderDetailResponse> filterList(FilterDeviceMAOrderDetailRequest detailRequest) {
@ -71,4 +75,14 @@ public class DeviceMAOrderDetailServiceImpl implements DeviceMAOrderDetailServic
}
return ResultVOUtils.success("删除成功");
}
@Override
public BaseResponse filterMAOrderDetail(String code) {
DeviceCollectOrderDetailEntity deviceCollectOrderDetail = deviceCollectOrderDetailDao.findOneByCode(code);
DeviceMAOrderDetailResponse response = deviceMaOrderDetailDao.filterMAOrderDetail(deviceCollectOrderDetail.getProductId());
response.setCode(code);
response.setDeviceStatus(1);
response.setMaintenanceStatus(0);
return ResultVOUtils.success(response);
}
}

@ -9,6 +9,7 @@ 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.AddDeviceMAOrderRequest;
import com.glxp.api.admin.req.inventory.FilterDeviceMAOrderRequest;
import com.glxp.api.admin.service.auth.CustomerService;
import com.glxp.api.admin.service.inventory.DeviceMAOrderService;
@ -98,7 +99,7 @@ public class DeviceMAOrderServiceImpl implements DeviceMAOrderService {
}
if (deviceMAOrderEntity.getStatus() == 1) {
//完成养护记录更新,查询此条养护记录详情中是否存在未养护完成设备
List<DeviceMAOrderDetailEntity> detailList = deviceMaOrderDetailDao.selectByOrderId(deviceMAOrderEntity.getOrderId());
List<DeviceMAOrderDetailEntity> detailList = deviceMaOrderDetailDao.selectByOrderId(deviceMAOrderEntity.getOrderId());
for (DeviceMAOrderDetailEntity deviceMAOrderDetailEntity : detailList) {
if (deviceMAOrderDetailEntity.getMaintenanceStatus() == 0) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, "存在未养护设备,请完成该设备养护!");
@ -124,4 +125,42 @@ public class DeviceMAOrderServiceImpl implements DeviceMAOrderService {
return ResultVOUtils.success("删除成功!");
}
@Override
public BaseResponse addDeviceMAOrder(AddDeviceMAOrderRequest addDeviceMAOrderRequest) {
if (null == addDeviceMAOrderRequest) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL);
}
if (StrUtil.isBlank(addDeviceMAOrderRequest.getCode())) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL);
}
//生成设备养护记录和详情
DeviceMAOrderEntity deviceMAOrderEntity = new DeviceMAOrderEntity();
deviceMAOrderEntity.setOrderId(gennerOrderUtils.createStOrderNo(new OrderNoTypeBean(Constant.DEVICE_MA_ORDER, "yyyyMMdd")));
deviceMAOrderEntity.setCreateUser(addDeviceMAOrderRequest.getCreateUser());
deviceMAOrderEntity.setCreateTime(addDeviceMAOrderRequest.getCreateTime());
deviceMAOrderEntity.setUpdateTime(DateUtil.getDateTime());
deviceMAOrderEntity.setStatus(1);
//查询领用详情表中此条码的数据
DeviceCollectOrderDetailEntity deviceCollectOrderDetail = deviceCollectOrderDetailDao.findOneByCode(addDeviceMAOrderRequest.getCode());
//详情
DeviceMAOrderDetailEntity detailEntity = new DeviceMAOrderDetailEntity();
detailEntity.setCreateTime(addDeviceMAOrderRequest.getCreateTime());
detailEntity.setOrderIdFk(deviceMAOrderEntity.getOrderId());
detailEntity.setCreateUser(detailEntity.getCreateUser());
detailEntity.setCode(addDeviceMAOrderRequest.getCode());
detailEntity.setNameCode(deviceCollectOrderDetail.getNameCode());
detailEntity.setBatchNo(deviceCollectOrderDetail.getBatchNo());
detailEntity.setProductId(deviceCollectOrderDetail.getProductId());
detailEntity.setProduceDate(deviceCollectOrderDetail.getProduceDate());
detailEntity.setExpireDate(deviceCollectOrderDetail.getExpireDate());
detailEntity.setSerialNo(deviceCollectOrderDetail.getSerialNo());
detailEntity.setMaintenanceStatus(addDeviceMAOrderRequest.getMaintenanceStatus());
detailEntity.setDeviceStatus(addDeviceMAOrderRequest.getDeviceStatus());
deviceMAOrderDao.insert(deviceMAOrderEntity);
deviceMaOrderDetailDao.insert(detailEntity);
return ResultVOUtils.success();
}
}

@ -334,4 +334,65 @@
</if>
</where>
</select>
<select id="selectDeviceList" resultType="com.glxp.api.admin.res.inventory.DeviceCollectOrderDetailResponse">
select dcod.id,
dcod.orderIdFk,
dcod.originCode,
dcod.code,
dcod.productId,
dcod.nameCode,
dcod.batchNo,
dcod.produceDate,
dcod.expireDate,
dcod.serialNo,
dcod.createTime,
dcod.updateTime,
dcod.invStorageCode,
dcod.invWarehouseCode,
dcod.invSpaceCode,
dcod.receiveStorageCode,
dcod.receiveWarehouseCode,
dcod.receiveSpaceCode,
bp.cpmctymc productName,
bp.zczbhhzbapzbh,
bp.ylqxzcrbarmc,
bp.ggxh,
iws.name invWarehouseName,
isp.name invSpaceName,
ad.name deptName
from device_collect_order_detail dcod
left join basic_udirel bu on bu.id = dcod.productId
left join basic_products bp on bu.uuid = bp.uuid
left join inv_warehouse_sub iws on iws.code = dcod.invWarehouseCode
left join inv_space isp on isp.code = dcod.invSpaceCode
left join device_collect_order dco on dco.orderId = dcod.orderIdFk
left join auth_dept ad on ad.code = dco.deptCode
<where>
<if test="code != null and code != ''">
AND dcod.code = #{code}
</if>
<if test="nameCode != null and nameCode != ''">
AND dcod.nameCode like concat('%', #{nameCode}, '%')
</if>
<if test="collectUser != null and collectUser != ''">
AND dco.collectUser = #{collectUser}
</if>
<if test="deptCode != null and deptCode != ''">
AND dco.deptCode = #{deptCode}
</if>
</where>
group by dcod.code
</select>
<select id="findOneByCode" resultMap="BaseResultMap">
select <include refid="Base_Column_List" />
from device_collect_order_detail
<where>
<if test="code != null and code != ''">
AND code = #{code}
</if>
</where>
limit 1
</select>
</mapper>

@ -266,4 +266,18 @@
select <include refid="Base_Column_List" />
from device_ma_order_detail where orderIdFk = #{orderId}
</select>
<select id="filterMAOrderDetail" resultType="com.glxp.api.admin.res.inventory.DeviceMAOrderDetailResponse">
select ip.productsName productName,
ip.ggxh,
ip.batchNo,
ip.productionDate,
ip.expireDate,
bp.zczbhhzbapzbh,
bp.ylqxzcrbarmc
from inv_product ip
left join basic_udirel bu on bu.id = ip.relIdFk
left join basic_products bp on bu.uuid = bp.uuid
where bu.id = #{productId}
</select>
</mapper>
Loading…
Cancel
Save