1.优化设备养护功能

zhairh
x_z 2 years ago
parent 098da1241b
commit e3dda6df25

@ -755,7 +755,7 @@ public class WareHouseController {
return ResultVOUtils.error(500, "当前库存不足不允许0库存出库");
}
} else {
int count = invProductDetailService.vailStockCount(code, addOrderRequest.getInvStorageCode(), addOrderRequest.getInvWarehouseCode(), null);
int count = invProductDetailService.vailStockCount(code, addOrderRequest.getLocStorageCode(), addOrderRequest.getInvWarehouseCode(), null);
if (count <= 0) {
return ResultVOUtils.error(500, "当前库存不足不允许0库存出库");
} 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.FilterDeviceMAOrderRequest;
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.common.enums.ResultEnum;
import com.glxp.api.common.res.BaseResponse;
@ -37,9 +38,9 @@ public class DeviceMAOrderController {
*/
@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<>();
List<DeviceMAOrderResponse> list = deviceMAOrderService.filterList(filterDeviceMAOrderRequest);
PageInfo<DeviceMAOrderResponse> pageInfo = new PageInfo<>(list);
PageSimpleResponse<DeviceMAOrderResponse> pageSimpleResponse = new PageSimpleResponse<>();
pageSimpleResponse.setTotal(pageInfo.getTotal());
pageSimpleResponse.setList(list);
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.req.inventory.FilterDeviceMAOrderRequest;
import com.glxp.api.admin.res.inventory.DeviceMAOrderResponse;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
@ -22,5 +23,5 @@ public interface DeviceMAOrderDao {
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 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.req.inventory.AddDeviceMAOrderRequest;
import com.glxp.api.admin.req.inventory.FilterDeviceMAOrderRequest;
import com.glxp.api.admin.res.inventory.DeviceMAOrderResponse;
import com.glxp.api.common.res.BaseResponse;
import java.util.List;
@ -18,7 +19,7 @@ public interface DeviceMAOrderService {
* @param filterDeviceMAOrderRequest
* @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.req.inventory.AddDeviceMAOrderRequest;
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.inventory.DeviceMAOrderService;
import com.glxp.api.admin.util.DateUtil;
@ -44,7 +45,7 @@ public class DeviceMAOrderServiceImpl implements DeviceMAOrderService {
private DeviceMaOrderDetailDao deviceMaOrderDetailDao;
@Override
public List<DeviceMAOrderEntity> filterList(FilterDeviceMAOrderRequest filterDeviceMAOrderRequest) {
public List<DeviceMAOrderResponse> filterList(FilterDeviceMAOrderRequest filterDeviceMAOrderRequest) {
if (null == filterDeviceMAOrderRequest) {
return Collections.emptyList();
}

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

Loading…
Cancel
Save