1.优化设备养护功能

zhairh
x_z 2 years ago
parent 098da1241b
commit e3dda6df25

@ -755,7 +755,7 @@ public class WareHouseController {
return ResultVOUtils.error(500, "当前库存不足不允许0库存出库"); return ResultVOUtils.error(500, "当前库存不足不允许0库存出库");
} }
} else { } else {
int count = invProductDetailService.vailStockCount(code, addOrderRequest.getInvStorageCode(), addOrderRequest.getInvWarehouseCode(), null); int count = invProductDetailService.vailStockCount(code, addOrderRequest.getLocStorageCode(), addOrderRequest.getInvWarehouseCode(), null);
if (count <= 0) { if (count <= 0) {
return ResultVOUtils.error(500, "当前库存不足不允许0库存出库"); return ResultVOUtils.error(500, "当前库存不足不允许0库存出库");
} else { } else {

@ -5,6 +5,7 @@ import com.glxp.api.admin.entity.inventory.DeviceMAOrderEntity;
import com.glxp.api.admin.req.inventory.AddDeviceMAOrderRequest; import com.glxp.api.admin.req.inventory.AddDeviceMAOrderRequest;
import com.glxp.api.admin.req.inventory.FilterDeviceMAOrderRequest; import com.glxp.api.admin.req.inventory.FilterDeviceMAOrderRequest;
import com.glxp.api.admin.res.PageSimpleResponse; import com.glxp.api.admin.res.PageSimpleResponse;
import com.glxp.api.admin.res.inventory.DeviceMAOrderResponse;
import com.glxp.api.admin.service.inventory.DeviceMAOrderService; import com.glxp.api.admin.service.inventory.DeviceMAOrderService;
import com.glxp.api.common.enums.ResultEnum; import com.glxp.api.common.enums.ResultEnum;
import com.glxp.api.common.res.BaseResponse; import com.glxp.api.common.res.BaseResponse;
@ -37,9 +38,9 @@ public class DeviceMAOrderController {
*/ */
@GetMapping("/device/MA/order/filterList") @GetMapping("/device/MA/order/filterList")
public BaseResponse filterList(FilterDeviceMAOrderRequest filterDeviceMAOrderRequest) { public BaseResponse filterList(FilterDeviceMAOrderRequest filterDeviceMAOrderRequest) {
List<DeviceMAOrderEntity> list = deviceMAOrderService.filterList(filterDeviceMAOrderRequest); List<DeviceMAOrderResponse> list = deviceMAOrderService.filterList(filterDeviceMAOrderRequest);
PageInfo<DeviceMAOrderEntity> pageInfo = new PageInfo<>(list); PageInfo<DeviceMAOrderResponse> pageInfo = new PageInfo<>(list);
PageSimpleResponse<DeviceMAOrderEntity> pageSimpleResponse = new PageSimpleResponse<>(); PageSimpleResponse<DeviceMAOrderResponse> pageSimpleResponse = new PageSimpleResponse<>();
pageSimpleResponse.setTotal(pageInfo.getTotal()); pageSimpleResponse.setTotal(pageInfo.getTotal());
pageSimpleResponse.setList(list); pageSimpleResponse.setList(list);
return ResultVOUtils.success(pageSimpleResponse); return ResultVOUtils.success(pageSimpleResponse);

@ -3,6 +3,7 @@ package com.glxp.api.admin.dao.inventory;
import com.glxp.api.admin.entity.inventory.DeviceMAOrderEntity; import com.glxp.api.admin.entity.inventory.DeviceMAOrderEntity;
import com.glxp.api.admin.req.inventory.FilterDeviceMAOrderRequest; import com.glxp.api.admin.req.inventory.FilterDeviceMAOrderRequest;
import com.glxp.api.admin.res.inventory.DeviceMAOrderResponse;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import java.util.List; import java.util.List;
@ -22,5 +23,5 @@ public interface DeviceMAOrderDao {
int updateByPrimaryKey(DeviceMAOrderEntity record); int updateByPrimaryKey(DeviceMAOrderEntity record);
List<DeviceMAOrderEntity> filterList(FilterDeviceMAOrderRequest filterDeviceMAOrderRequest); List<DeviceMAOrderResponse> filterList(FilterDeviceMAOrderRequest filterDeviceMAOrderRequest);
} }

@ -26,4 +26,9 @@ public class FilterDeviceMAOrderRequest extends ListPageRequest {
*/ */
private Integer status; private Integer status;
/**
*
*/
private String code;
} }

@ -0,0 +1,17 @@
package com.glxp.api.admin.res.inventory;
import com.glxp.api.admin.entity.inventory.DeviceMAOrderEntity;
import lombok.Data;
/**
*
*/
@Data
public class DeviceMAOrderResponse extends DeviceMAOrderEntity {
/**
*
*/
private String code;
}

@ -3,6 +3,7 @@ package com.glxp.api.admin.service.inventory;
import com.glxp.api.admin.entity.inventory.DeviceMAOrderEntity; import com.glxp.api.admin.entity.inventory.DeviceMAOrderEntity;
import com.glxp.api.admin.req.inventory.AddDeviceMAOrderRequest; import com.glxp.api.admin.req.inventory.AddDeviceMAOrderRequest;
import com.glxp.api.admin.req.inventory.FilterDeviceMAOrderRequest; import com.glxp.api.admin.req.inventory.FilterDeviceMAOrderRequest;
import com.glxp.api.admin.res.inventory.DeviceMAOrderResponse;
import com.glxp.api.common.res.BaseResponse; import com.glxp.api.common.res.BaseResponse;
import java.util.List; import java.util.List;
@ -18,7 +19,7 @@ public interface DeviceMAOrderService {
* @param filterDeviceMAOrderRequest * @param filterDeviceMAOrderRequest
* @return * @return
*/ */
List<DeviceMAOrderEntity> filterList(FilterDeviceMAOrderRequest filterDeviceMAOrderRequest); List<DeviceMAOrderResponse> filterList(FilterDeviceMAOrderRequest filterDeviceMAOrderRequest);
/** /**
* *

@ -11,6 +11,7 @@ import com.glxp.api.admin.entity.inventory.DeviceMAOrderDetailEntity;
import com.glxp.api.admin.entity.inventory.DeviceMAOrderEntity; import com.glxp.api.admin.entity.inventory.DeviceMAOrderEntity;
import com.glxp.api.admin.req.inventory.AddDeviceMAOrderRequest; import com.glxp.api.admin.req.inventory.AddDeviceMAOrderRequest;
import com.glxp.api.admin.req.inventory.FilterDeviceMAOrderRequest; import com.glxp.api.admin.req.inventory.FilterDeviceMAOrderRequest;
import com.glxp.api.admin.res.inventory.DeviceMAOrderResponse;
import com.glxp.api.admin.service.auth.CustomerService; import com.glxp.api.admin.service.auth.CustomerService;
import com.glxp.api.admin.service.inventory.DeviceMAOrderService; import com.glxp.api.admin.service.inventory.DeviceMAOrderService;
import com.glxp.api.admin.util.DateUtil; import com.glxp.api.admin.util.DateUtil;
@ -44,7 +45,7 @@ public class DeviceMAOrderServiceImpl implements DeviceMAOrderService {
private DeviceMaOrderDetailDao deviceMaOrderDetailDao; private DeviceMaOrderDetailDao deviceMaOrderDetailDao;
@Override @Override
public List<DeviceMAOrderEntity> filterList(FilterDeviceMAOrderRequest filterDeviceMAOrderRequest) { public List<DeviceMAOrderResponse> filterList(FilterDeviceMAOrderRequest filterDeviceMAOrderRequest) {
if (null == filterDeviceMAOrderRequest) { if (null == filterDeviceMAOrderRequest) {
return Collections.emptyList(); return Collections.emptyList();
} }

@ -149,19 +149,22 @@
where id = #{id,jdbcType=INTEGER} where id = #{id,jdbcType=INTEGER}
</update> </update>
<select id="filterList" resultType="com.glxp.api.admin.entity.inventory.DeviceMAOrderEntity"> <select id="filterList" resultType="com.glxp.api.admin.res.inventory.DeviceMAOrderResponse">
select select dmo.*, dmod.code
<include refid="Base_Column_List"/> from device_ma_order dmo
from device_ma_order left join device_ma_order_detail dmod on dmo.orderId = dmod.orderIdFk
<where> <where>
<if test="orderId != null and orderId != ''"> <if test="orderId != null and orderId != ''">
AND orderId like concat('%', #{orderId}, '%') AND dmo.orderId like concat('%', #{orderId}, '%')
</if> </if>
<if test="status != null"> <if test="status != null">
AND status = #{status} AND dmo.status = #{status}
</if> </if>
<if test="collOrderId != null and collOrderId != ''"> <if test="collOrderId != null and collOrderId != ''">
AND collOrderId like concat('%', #{collOrderId}, '%') AND dmo.collOrderId like concat('%', #{collOrderId}, '%')
</if>
<if test="code != null and code != ''">
AND dmod.code like concat('%', #{code}, '%')
</if> </if>
</where> </where>
</select> </select>

Loading…
Cancel
Save