【admin】修复# 1.修复检修订单抢单,接单,退单问题
							parent
							
								
									27b199adfe
								
							
						
					
					
						commit
						a253e2f104
					
				|  | @ -1,54 +0,0 @@ | ||||||
| package com.hcy.admin.service.order; |  | ||||||
| 
 |  | ||||||
| import com.hcy.admin.validate.common.PageParam; |  | ||||||
| import com.hcy.admin.validate.order.OrderPartParam; |  | ||||||
| import com.hcy.admin.vo.order.OrderPartDetailVo; |  | ||||||
| import com.hcy.admin.vo.order.OrderPartListVo; |  | ||||||
| import com.hcy.common.core.PageResult; |  | ||||||
| 
 |  | ||||||
| import java.util.Map; |  | ||||||
| 
 |  | ||||||
| /** |  | ||||||
|  * 订单配件服务接口类 |  | ||||||
|  */ |  | ||||||
| public interface IOrderPartService { |  | ||||||
| 
 |  | ||||||
|     /** |  | ||||||
|      * 订单配件列表 |  | ||||||
|      * |  | ||||||
|      * @param pageParam 分页参数 |  | ||||||
|      * @param params 搜索参数 |  | ||||||
|      * @return PageResult<OrderPartVo> |  | ||||||
|      */ |  | ||||||
|     PageResult<OrderPartListVo> list(PageParam pageParam, Map<String, String> params); |  | ||||||
| 
 |  | ||||||
|     /** |  | ||||||
|      * 订单配件详情 |  | ||||||
|      * |  | ||||||
|      * @param id 主键ID |  | ||||||
|      * @return OrderPart |  | ||||||
|      */ |  | ||||||
|     OrderPartDetailVo detail(Integer id); |  | ||||||
| 
 |  | ||||||
|     /** |  | ||||||
|      * 订单配件新增 |  | ||||||
|      * |  | ||||||
|      * @param orderPartParam 参数 |  | ||||||
|      */ |  | ||||||
|     void add(OrderPartParam orderPartParam); |  | ||||||
| 
 |  | ||||||
|     /** |  | ||||||
|      * 订单配件编辑 |  | ||||||
|      * |  | ||||||
|      * @param orderPartParam 参数 |  | ||||||
|      */ |  | ||||||
|     void edit(OrderPartParam orderPartParam); |  | ||||||
| 
 |  | ||||||
|     /** |  | ||||||
|      * 订单配件删除 |  | ||||||
|      * |  | ||||||
|      * @param id 主键ID |  | ||||||
|      */ |  | ||||||
|     void del(Long id); |  | ||||||
| 
 |  | ||||||
| } |  | ||||||
|  | @ -218,7 +218,14 @@ public class MaintenanceOrderServiceImpl implements IMaintenanceOrderService { | ||||||
|         Assert.notNull(model, "数据不存在!"); |         Assert.notNull(model, "数据不存在!"); | ||||||
| 
 | 
 | ||||||
|         if(model.getOrderStatus() == MaintenanceOrderStatusEnum.WAITING_LIST.getStatus() || |         if(model.getOrderStatus() == MaintenanceOrderStatusEnum.WAITING_LIST.getStatus() || | ||||||
|                 model.getOrderStatus() == MaintenanceOrderStatusEnum.PENDING_ORDER.getStatus()){ |                 model.getOrderStatus() == MaintenanceOrderStatusEnum.PENDING_ORDER.getStatus() | ||||||
|  |                 || model.getOrderStatus() == MaintenanceOrderStatusEnum.CHARGEBACK.getStatus() | ||||||
|  |                 || model.getOrderStatus() == MaintenanceOrderStatusEnum.ORDER_TIMEOUT.getStatus()){ | ||||||
|  | 
 | ||||||
|  |             //重新指派员工
 | ||||||
|  |             if(param.getReceiverId() != null && param.getId() != null){ | ||||||
|  |                 model.setOrderStatus(MaintenanceOrderStatusEnum.PENDING_ORDER.getStatus()); | ||||||
|  |             } | ||||||
|             model.setReceiverId(param.getReceiverId()); |             model.setReceiverId(param.getReceiverId()); | ||||||
|             model.setReceiverType(param.getReceiverType()); |             model.setReceiverType(param.getReceiverType()); | ||||||
|             model.setOrderDistance(param.getOrderDistance()); |             model.setOrderDistance(param.getOrderDistance()); | ||||||
|  |  | ||||||
|  | @ -1,154 +0,0 @@ | ||||||
| package com.hcy.admin.service.order.impl; |  | ||||||
| 
 |  | ||||||
| import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |  | ||||||
| import com.baomidou.mybatisplus.core.metadata.IPage; |  | ||||||
| import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |  | ||||||
| import com.hcy.admin.service.order.IOrderPartService; |  | ||||||
| import com.hcy.admin.validate.common.PageParam; |  | ||||||
| import com.hcy.admin.validate.order.OrderPartParam; |  | ||||||
| import com.hcy.admin.vo.order.MaintenanceOrderListVo; |  | ||||||
| import com.hcy.admin.vo.order.OrderPartDetailVo; |  | ||||||
| import com.hcy.admin.vo.order.OrderPartListVo; |  | ||||||
| import com.hcy.common.core.PageResult; |  | ||||||
| import com.hcy.common.entity.order.MaintenanceOrder; |  | ||||||
| import com.hcy.common.entity.order.OrderPart; |  | ||||||
| import com.hcy.common.mapper.order.OrderPartMapper; |  | ||||||
| import org.springframework.beans.BeanUtils; |  | ||||||
| import org.springframework.stereotype.Service; |  | ||||||
| import org.springframework.util.Assert; |  | ||||||
| 
 |  | ||||||
| import javax.annotation.Resource; |  | ||||||
| import java.util.*; |  | ||||||
| 
 |  | ||||||
| /** |  | ||||||
|  * 订单配件实现类 |  | ||||||
|  */ |  | ||||||
| @Service |  | ||||||
| public class OrderPartServiceImpl implements IOrderPartService { |  | ||||||
|          |  | ||||||
|     @Resource |  | ||||||
|     OrderPartMapper orderPartMapper; |  | ||||||
| 
 |  | ||||||
|     /** |  | ||||||
|      * 订单配件列表 |  | ||||||
|      * |  | ||||||
|      * @param pageParam 分页参数 |  | ||||||
|      * @param params 搜索参数 |  | ||||||
|      * @return PageResult<OrderPartListVo> |  | ||||||
|      */ |  | ||||||
|     @Override |  | ||||||
|     public PageResult<OrderPartListVo> list(PageParam pageParam, Map<String, String> params) { |  | ||||||
|         Integer page  = pageParam.getPageNo(); |  | ||||||
|         Integer limit = pageParam.getPageSize(); |  | ||||||
| 
 |  | ||||||
|         QueryWrapper<OrderPart> queryWrapper = new QueryWrapper<>(); |  | ||||||
|         queryWrapper.eq("is_delete", 0); |  | ||||||
|         queryWrapper.orderByDesc("id"); |  | ||||||
| 
 |  | ||||||
|         orderPartMapper.setSearch(queryWrapper, params, new String[]{ |  | ||||||
|             "=:partCode@part_code:str", |  | ||||||
|             "like:partName@part_name:str", |  | ||||||
|             "=:specificationModel@specification_model:str", |  | ||||||
|             "=:unit:str", |  | ||||||
|             "=:price:str", |  | ||||||
|             "=:quantity:long", |  | ||||||
|             "=:totalPrice@total_price:str", |  | ||||||
|         }); |  | ||||||
| 
 |  | ||||||
|         IPage<OrderPart> iPage = orderPartMapper.selectPage(new Page<>(page, limit), queryWrapper); |  | ||||||
| 
 |  | ||||||
|         List<OrderPartListVo> list = new LinkedList<>(); |  | ||||||
|         for(OrderPart item : iPage.getRecords()) { |  | ||||||
|             OrderPartListVo vo = new OrderPartListVo(); |  | ||||||
|             BeanUtils.copyProperties(item, vo); |  | ||||||
|             list.add(vo); |  | ||||||
|         } |  | ||||||
| 
 |  | ||||||
|         return PageResult.iPageHandle(iPage.getTotal(), iPage.getCurrent(), iPage.getSize(), list); |  | ||||||
|     } |  | ||||||
| 
 |  | ||||||
|     /** |  | ||||||
|      * 订单配件详情 |  | ||||||
|      * |  | ||||||
|      * @param id 主键参数 |  | ||||||
|      * @return OrderPart |  | ||||||
|      */ |  | ||||||
|     @Override |  | ||||||
|     public OrderPartDetailVo detail(Integer id) { |  | ||||||
|         OrderPart model = orderPartMapper.selectOne( |  | ||||||
|                 new QueryWrapper<OrderPart>() |  | ||||||
|                     .eq("id", id) |  | ||||||
|                     .eq("is_delete", 0) |  | ||||||
|                     .last("limit 1")); |  | ||||||
| 
 |  | ||||||
|         Assert.notNull(model, "数据不存在"); |  | ||||||
| 
 |  | ||||||
|         OrderPartDetailVo vo = new OrderPartDetailVo(); |  | ||||||
|         BeanUtils.copyProperties(model, vo); |  | ||||||
|         return vo; |  | ||||||
|     } |  | ||||||
| 
 |  | ||||||
|     /** |  | ||||||
|      * 订单配件新增 |  | ||||||
|      * |  | ||||||
|      * @param orderPartParam 参数 |  | ||||||
|      */ |  | ||||||
|     @Override |  | ||||||
|     public void add(OrderPartParam orderPartParam) { |  | ||||||
|         OrderPart model = new OrderPart(); |  | ||||||
|         model.setPartCode(orderPartParam.getPartCode()); |  | ||||||
|         model.setPartName(orderPartParam.getPartName()); |  | ||||||
|         model.setSpecificationModel(orderPartParam.getSpecificationModel()); |  | ||||||
|         model.setUnit(orderPartParam.getUnit()); |  | ||||||
|         model.setPrice(orderPartParam.getPrice()); |  | ||||||
|         model.setQuantity(orderPartParam.getQuantity()); |  | ||||||
|         model.setTotalPrice(orderPartParam.getTotalPrice()); |  | ||||||
|         orderPartMapper.insert(model); |  | ||||||
|     } |  | ||||||
| 
 |  | ||||||
|     /** |  | ||||||
|      * 订单配件编辑 |  | ||||||
|      * |  | ||||||
|      * @param orderPartParam 参数 |  | ||||||
|      */ |  | ||||||
|     @Override |  | ||||||
|     public void edit(OrderPartParam orderPartParam) { |  | ||||||
|         OrderPart model = orderPartMapper.selectOne( |  | ||||||
|                 new QueryWrapper<OrderPart>() |  | ||||||
|                     .eq("id",  orderPartParam.getId()) |  | ||||||
|                     .eq("is_delete", 0) |  | ||||||
|                     .last("limit 1")); |  | ||||||
| 
 |  | ||||||
|         Assert.notNull(model, "数据不存在!"); |  | ||||||
| 
 |  | ||||||
|         model.setId(orderPartParam.getId()); |  | ||||||
|         model.setPartCode(orderPartParam.getPartCode()); |  | ||||||
|         model.setPartName(orderPartParam.getPartName()); |  | ||||||
|         model.setSpecificationModel(orderPartParam.getSpecificationModel()); |  | ||||||
|         model.setUnit(orderPartParam.getUnit()); |  | ||||||
|         model.setPrice(orderPartParam.getPrice()); |  | ||||||
|         model.setQuantity(orderPartParam.getQuantity()); |  | ||||||
|         model.setTotalPrice(orderPartParam.getTotalPrice()); |  | ||||||
|         orderPartMapper.updateById(model); |  | ||||||
|     } |  | ||||||
| 
 |  | ||||||
|     /** |  | ||||||
|      * 订单配件删除 |  | ||||||
|      * |  | ||||||
|      * @param id 主键ID |  | ||||||
|      */ |  | ||||||
|     @Override |  | ||||||
|     public void del(Long id) { |  | ||||||
|         OrderPart model = orderPartMapper.selectOne( |  | ||||||
|                 new QueryWrapper<OrderPart>() |  | ||||||
|                     .eq("id", id) |  | ||||||
|                     .eq("is_delete", 0) |  | ||||||
|                     .last("limit 1")); |  | ||||||
| 
 |  | ||||||
|         Assert.notNull(model, "数据不存在!"); |  | ||||||
| 
 |  | ||||||
|         model.setIsDelete(1); |  | ||||||
|         orderPartMapper.updateById(model); |  | ||||||
|     } |  | ||||||
| 
 |  | ||||||
| } |  | ||||||
|  | @ -1,54 +0,0 @@ | ||||||
| package com.hcy.admin.validate.order; |  | ||||||
| 
 |  | ||||||
| import lombok.EqualsAndHashCode; |  | ||||||
| import lombok.experimental.Accessors; |  | ||||||
| import org.hibernate.validator.constraints.Length; |  | ||||||
| 
 |  | ||||||
| import lombok.Data; |  | ||||||
| import javax.validation.constraints.*; |  | ||||||
| import java.io.Serializable; |  | ||||||
| import java.math.BigDecimal; |  | ||||||
| 
 |  | ||||||
| /** |  | ||||||
|  * 订单配件参数 |  | ||||||
|  */ |  | ||||||
| @Data |  | ||||||
| @EqualsAndHashCode(callSuper = false) |  | ||||||
| @Accessors(chain = true) |  | ||||||
| public class OrderPartParam implements Serializable { |  | ||||||
| 
 |  | ||||||
|     private static final long serialVersionUID = 1L; |  | ||||||
| 
 |  | ||||||
|     public interface create{} |  | ||||||
|     public interface update{} |  | ||||||
|     public interface delete{} |  | ||||||
| 
 |  | ||||||
|     private Long id; |  | ||||||
| 
 |  | ||||||
|     @NotNull(message = "partCode参数缺失", groups = {create.class, update.class}) |  | ||||||
|     @Length(max = 100, message = "partCode参数不能超出100个字符", groups = {create.class, update.class}) |  | ||||||
|     private String partCode; |  | ||||||
| 
 |  | ||||||
|     @NotNull(message = "partName参数缺失", groups = {create.class, update.class}) |  | ||||||
|     @Length(max = 50, message = "partName参数不能超出50个字符", groups = {create.class, update.class}) |  | ||||||
|     private String partName; |  | ||||||
| 
 |  | ||||||
|     @NotNull(message = "specificationModel参数缺失", groups = {create.class, update.class}) |  | ||||||
|     @Length(max = 50, message = "specificationModel参数不能超出50个字符", groups = {create.class, update.class}) |  | ||||||
|     private String specificationModel; |  | ||||||
| 
 |  | ||||||
|     @NotNull(message = "unit参数缺失", groups = {create.class, update.class}) |  | ||||||
|     @Length(max = 20, message = "unit参数不能超出20个字符", groups = {create.class, update.class}) |  | ||||||
|     private String unit; |  | ||||||
| 
 |  | ||||||
|     @NotNull(message = "price参数缺失", groups = {create.class, update.class}) |  | ||||||
|     private BigDecimal price; |  | ||||||
| 
 |  | ||||||
|     @NotNull(message = "quantity参数缺失", groups = {create.class, update.class}) |  | ||||||
|     @DecimalMin(value = "0", message = "quantity参数值不能少于0", groups = {create.class, update.class}) |  | ||||||
|     private Long quantity; |  | ||||||
| 
 |  | ||||||
|     @NotNull(message = "totalPrice参数缺失", groups = {create.class, update.class}) |  | ||||||
|     private BigDecimal totalPrice; |  | ||||||
| 
 |  | ||||||
| } |  | ||||||
|  | @ -1,25 +0,0 @@ | ||||||
| package com.hcy.admin.vo.order; |  | ||||||
| 
 |  | ||||||
| import lombok.Data; |  | ||||||
| 
 |  | ||||||
| import java.io.Serializable; |  | ||||||
| import java.math.BigDecimal; |  | ||||||
| 
 |  | ||||||
| /** |  | ||||||
|  * OrderPartVo |  | ||||||
|  */ |  | ||||||
| @Data |  | ||||||
| public class OrderPartDetailVo implements Serializable { |  | ||||||
| 
 |  | ||||||
|     private static final long serialVersionUID = 1L; |  | ||||||
| 
 |  | ||||||
|     private Long id; // id
 |  | ||||||
|     private String partCode; // 备件编码
 |  | ||||||
|     private String partName; // 备件名称
 |  | ||||||
|     private String specificationModel; // 规格型号
 |  | ||||||
|     private String unit; // 单位
 |  | ||||||
|     private BigDecimal price; // 价格
 |  | ||||||
|     private Long quantity; // 数量
 |  | ||||||
|     private BigDecimal totalPrice; // 总价
 |  | ||||||
| 
 |  | ||||||
| } |  | ||||||
|  | @ -1,25 +0,0 @@ | ||||||
| package com.hcy.admin.vo.order; |  | ||||||
| 
 |  | ||||||
| import lombok.Data; |  | ||||||
| 
 |  | ||||||
| import java.io.Serializable; |  | ||||||
| import java.math.BigDecimal; |  | ||||||
| 
 |  | ||||||
| /** |  | ||||||
|  * OrderPartVo |  | ||||||
|  */ |  | ||||||
| @Data |  | ||||||
| public class OrderPartListVo implements Serializable { |  | ||||||
| 
 |  | ||||||
|     private static final long serialVersionUID = 1L; |  | ||||||
| 
 |  | ||||||
|     private Long id; // id
 |  | ||||||
|     private String partCode; // 备件编码
 |  | ||||||
|     private String partName; // 备件名称
 |  | ||||||
|     private String specificationModel; // 规格型号
 |  | ||||||
|     private String unit; // 单位
 |  | ||||||
|     private BigDecimal price; // 价格
 |  | ||||||
|     private Long quantity; // 数量
 |  | ||||||
|     private BigDecimal totalPrice; // 总价
 |  | ||||||
| 
 |  | ||||||
| } |  | ||||||
|  | @ -0,0 +1,33 @@ | ||||||
|  | package com.hcy.common.dto; | ||||||
|  | 
 | ||||||
|  | import com.baomidou.mybatisplus.annotation.IdType; | ||||||
|  | import com.baomidou.mybatisplus.annotation.TableId; | ||||||
|  | import lombok.Data; | ||||||
|  | 
 | ||||||
|  | import java.io.Serializable; | ||||||
|  | import java.math.BigDecimal; | ||||||
|  | 
 | ||||||
|  | /** | ||||||
|  |  * 备件信息实体 | ||||||
|  |  */ | ||||||
|  | @Data | ||||||
|  | public class SparePartDto implements Serializable { | ||||||
|  | 
 | ||||||
|  |     private static final long serialVersionUID = 1L; | ||||||
|  | 
 | ||||||
|  |     @TableId(value="id", type= IdType.AUTO) | ||||||
|  |     private Long id; // 主键id
 | ||||||
|  |     private String sparePartsCode; // 备件编码
 | ||||||
|  |     private String sparePartsName; // 备件名称
 | ||||||
|  |     private Long warehouseId; // 所属仓库
 | ||||||
|  |     private String specificationsModel; // 规格型号
 | ||||||
|  |     private String unit; // 单位
 | ||||||
|  |     private Integer quantity; // 库存数量
 | ||||||
|  |     private BigDecimal unitPrice; // 单价
 | ||||||
|  |     private Integer isDelete; // 是否删除: [0=否, 1=是]
 | ||||||
|  |     private Long createTime; // 创建时间
 | ||||||
|  |     private Long updateTime; // 更新时间
 | ||||||
|  |     private Long deleteTime; // 删除时间
 | ||||||
|  | 
 | ||||||
|  |     private String keywords; // 关键字
 | ||||||
|  | } | ||||||
|  | @ -58,4 +58,6 @@ public class MaintenanceOrderDto implements Serializable { | ||||||
|     private Long equipmentCityId; //设备市id
 |     private Long equipmentCityId; //设备市id
 | ||||||
|     private double longitude; //经度
 |     private double longitude; //经度
 | ||||||
|     private double latitude; //纬度
 |     private double latitude; //纬度
 | ||||||
|  |     private String orderStatusIds; //订单状态ids
 | ||||||
|  |     private String likeWork; //关键字
 | ||||||
| } | } | ||||||
|  |  | ||||||
|  | @ -0,0 +1,32 @@ | ||||||
|  | package com.hcy.common.dto.order; | ||||||
|  | 
 | ||||||
|  | import com.baomidou.mybatisplus.annotation.IdType; | ||||||
|  | import com.baomidou.mybatisplus.annotation.TableId; | ||||||
|  | import lombok.Data; | ||||||
|  | 
 | ||||||
|  | import java.io.Serializable; | ||||||
|  | import java.math.BigDecimal; | ||||||
|  | 
 | ||||||
|  | /** | ||||||
|  |  * 订单配件实体 | ||||||
|  |  */ | ||||||
|  | @Data | ||||||
|  | public class OrderSparePart implements Serializable { | ||||||
|  | 
 | ||||||
|  |     private static final long serialVersionUID = 1L; | ||||||
|  | 
 | ||||||
|  |     @TableId(value="id", type= IdType.AUTO) | ||||||
|  |     private Long id; // id
 | ||||||
|  |     private Long maintenanceOrderId; //检修单id
 | ||||||
|  |     private Long sparePartsId; // 备件id
 | ||||||
|  |     private String sparePartsCode; // 备件编码
 | ||||||
|  |     private String sparePartsName; // 备件名称
 | ||||||
|  |     private String warehouseName; // 所属仓库名称
 | ||||||
|  |     private String specificationsModel; // 规格型号
 | ||||||
|  |     private String unit; // 单位
 | ||||||
|  |     private BigDecimal price; // 价格
 | ||||||
|  |     private Long quantity; // 数量
 | ||||||
|  |     private BigDecimal totalPrice; // 总价
 | ||||||
|  |     private Integer isDelete; // 是否删除  0-未删除 1-删除
 | ||||||
|  | 
 | ||||||
|  | } | ||||||
|  | @ -35,6 +35,7 @@ public class MaintenanceOrder implements Serializable { | ||||||
|     private BigDecimal orderDistance; // 订单距离
 |     private BigDecimal orderDistance; // 订单距离
 | ||||||
|     private BigDecimal totalAmount; // 总金额
 |     private BigDecimal totalAmount; // 总金额
 | ||||||
|     private BigDecimal actualAmount; // 实际金额
 |     private BigDecimal actualAmount; // 实际金额
 | ||||||
|  |     @TableField(value = "receiver_id",updateStrategy = FieldStrategy.IGNORED) | ||||||
|     private Long receiverId; // 接单人id
 |     private Long receiverId; // 接单人id
 | ||||||
|     private Long repairId; // 返修id
 |     private Long repairId; // 返修id
 | ||||||
|     private Date receiverTime; // 接单时间
 |     private Date receiverTime; // 接单时间
 | ||||||
|  |  | ||||||
|  | @ -4,6 +4,8 @@ import com.hcy.common.core.basics.IBaseMapper; | ||||||
| import com.hcy.common.dto.largeDataDto.ClientLargeDataDto; | import com.hcy.common.dto.largeDataDto.ClientLargeDataDto; | ||||||
| import com.hcy.common.entity.client.Client; | import com.hcy.common.entity.client.Client; | ||||||
| import org.apache.ibatis.annotations.Mapper; | import org.apache.ibatis.annotations.Mapper; | ||||||
|  | import org.apache.ibatis.annotations.Param; | ||||||
|  | import org.apache.ibatis.annotations.Select; | ||||||
| 
 | 
 | ||||||
| import java.util.List; | import java.util.List; | ||||||
| 
 | 
 | ||||||
|  | @ -20,4 +22,6 @@ public interface ClientMapper extends IBaseMapper<Client> { | ||||||
|      */ |      */ | ||||||
|     List<ClientLargeDataDto> clientEquipmentList(); |     List<ClientLargeDataDto> clientEquipmentList(); | ||||||
| 
 | 
 | ||||||
|  |     @Select("select * from la_client where is_delete = 0 and id = #{id}") | ||||||
|  |     Client findClientById(@Param("id") Long id); | ||||||
| } | } | ||||||
|  |  | ||||||
|  | @ -4,6 +4,8 @@ import com.hcy.common.core.basics.IBaseMapper; | ||||||
| import com.hcy.common.dto.largeDataDto.ClientLargeDataDto; | import com.hcy.common.dto.largeDataDto.ClientLargeDataDto; | ||||||
| import com.hcy.common.entity.client.Equipment; | import com.hcy.common.entity.client.Equipment; | ||||||
| import org.apache.ibatis.annotations.Mapper; | import org.apache.ibatis.annotations.Mapper; | ||||||
|  | import org.apache.ibatis.annotations.Param; | ||||||
|  | import org.apache.ibatis.annotations.Select; | ||||||
| 
 | 
 | ||||||
| import java.util.List; | import java.util.List; | ||||||
| 
 | 
 | ||||||
|  | @ -19,5 +21,4 @@ public interface EquipmentMapper extends IBaseMapper<Equipment> { | ||||||
|      * @return |      * @return | ||||||
|      */ |      */ | ||||||
|     List<ClientLargeDataDto> provinceEquipment(); |     List<ClientLargeDataDto> provinceEquipment(); | ||||||
| 
 |  | ||||||
| } | } | ||||||
|  |  | ||||||
|  | @ -3,6 +3,8 @@ package com.hcy.common.mapper.fault; | ||||||
| import com.hcy.common.core.basics.IBaseMapper; | import com.hcy.common.core.basics.IBaseMapper; | ||||||
| import com.hcy.common.entity.fault.Fault; | import com.hcy.common.entity.fault.Fault; | ||||||
| import org.apache.ibatis.annotations.Mapper; | import org.apache.ibatis.annotations.Mapper; | ||||||
|  | import org.apache.ibatis.annotations.Param; | ||||||
|  | import org.apache.ibatis.annotations.Select; | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
|  * 常见故障Mapper |  * 常见故障Mapper | ||||||
|  | @ -10,4 +12,6 @@ import org.apache.ibatis.annotations.Mapper; | ||||||
| @Mapper | @Mapper | ||||||
| public interface FaultMapper extends IBaseMapper<Fault> { | public interface FaultMapper extends IBaseMapper<Fault> { | ||||||
| 
 | 
 | ||||||
|  |     @Select("select * from la_fault where is_delete = 0 and id = #{id}") | ||||||
|  |     Fault findFaultById(@Param("id") Long id); | ||||||
| } | } | ||||||
|  |  | ||||||
|  | @ -18,12 +18,12 @@ public interface MaintenanceOrderMapper extends IBaseMapper<MaintenanceOrder> { | ||||||
| 
 | 
 | ||||||
|     Page<MaintenanceOrderDto> list(Page page,@Param("param") MaintenanceOrderDto maintenanceOrderDto); |     Page<MaintenanceOrderDto> list(Page page,@Param("param") MaintenanceOrderDto maintenanceOrderDto); | ||||||
| 
 | 
 | ||||||
|     List<MaintenanceOrderDto> list(MaintenanceOrderDto maintenanceOrderDto); |     List<MaintenanceOrderDto> list(@Param("param") MaintenanceOrderDto maintenanceOrderDto); | ||||||
| 
 | 
 | ||||||
|     /** |     /** | ||||||
|      * 通过订单id查询检修订单 |      * 通过订单id查询检修订单 | ||||||
|      * @return MaintenanceOrder |      * @return MaintenanceOrder | ||||||
|      */ |      */ | ||||||
|     @Select("select * from lc_maintenance_order where is_delete = 0 and id = #{id}") |     @Select("select * from la_maintenance_order where is_delete = 0 and id = #{id}") | ||||||
|     MaintenanceOrder findMaintenanceOrderById(@Param("id") Long id); |     MaintenanceOrder findMaintenanceOrderById(@Param("id") Long id); | ||||||
| } | } | ||||||
|  |  | ||||||
|  | @ -0,0 +1,12 @@ | ||||||
|  | package com.hcy.common.mapper.order; | ||||||
|  | 
 | ||||||
|  | import com.hcy.common.core.basics.IBaseMapper; | ||||||
|  | import com.hcy.common.dto.order.OrderSparePart; | ||||||
|  | import org.apache.ibatis.annotations.Mapper; | ||||||
|  | 
 | ||||||
|  | /** | ||||||
|  |  * 订单配件Mapper | ||||||
|  |  */ | ||||||
|  | @Mapper | ||||||
|  | public interface OrderSparePartMapper extends IBaseMapper<OrderSparePart> { | ||||||
|  | } | ||||||
|  | @ -1,13 +1,24 @@ | ||||||
| package com.hcy.common.mapper.sparePart; | package com.hcy.common.mapper.sparePart; | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|  | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | ||||||
|  | import com.github.pagehelper.page.PageParams; | ||||||
| import com.hcy.common.core.basics.IBaseMapper; | import com.hcy.common.core.basics.IBaseMapper; | ||||||
|  | import com.hcy.common.dto.SparePartDto; | ||||||
| import com.hcy.common.entity.sparePart.SparePart; | import com.hcy.common.entity.sparePart.SparePart; | ||||||
| import org.apache.ibatis.annotations.Mapper; | import org.apache.ibatis.annotations.Mapper; | ||||||
|  | import org.apache.ibatis.annotations.Param; | ||||||
|  | import org.apache.ibatis.annotations.Select; | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
|  * 备件信息Mapper |  * 备件信息Mapper | ||||||
|  */ |  */ | ||||||
| @Mapper | @Mapper | ||||||
| public interface SparePartMapper extends IBaseMapper<SparePart> { | public interface SparePartMapper extends IBaseMapper<SparePart> { | ||||||
|  | 
 | ||||||
|  |     Page<SparePartDto> pageList(Page page,@Param("param") SparePartDto sparePartDto); | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  |     @Select("select * from la_spare_part where is_delete = 0 and id = #{id}") | ||||||
|  |     SparePart findSparePart(@Param("id") Long id); | ||||||
| } | } | ||||||
|  |  | ||||||
|  | @ -7,6 +7,7 @@ import com.hcy.common.dto.largeDataDto.AdminLargeDataDto; | ||||||
| import com.hcy.common.entity.system.SystemAuthAdmin; | import com.hcy.common.entity.system.SystemAuthAdmin; | ||||||
| import org.apache.ibatis.annotations.Mapper; | import org.apache.ibatis.annotations.Mapper; | ||||||
| import org.apache.ibatis.annotations.Param; | import org.apache.ibatis.annotations.Param; | ||||||
|  | import org.apache.ibatis.annotations.Select; | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
|  * 系统管理员Mapper |  * 系统管理员Mapper | ||||||
|  | @ -21,4 +22,7 @@ public interface SystemAuthAdminMapper extends IBaseMapper<SystemAuthAdmin> { | ||||||
|      * @return |      * @return | ||||||
|      */ |      */ | ||||||
|     AdminLargeDataDto personnelStatistics(); |     AdminLargeDataDto personnelStatistics(); | ||||||
|  | 
 | ||||||
|  |     @Select("select * from la_system_auth_admin where is_delete = 0 and user_id = #{userId}") | ||||||
|  |     SystemAuthAdmin findSystemAuthAdminByUserId(@Param("userId") Integer userId); | ||||||
| } | } | ||||||
|  |  | ||||||
|  | @ -4,10 +4,14 @@ package com.hcy.common.mapper.warehouse; | ||||||
| import com.hcy.common.core.basics.IBaseMapper; | import com.hcy.common.core.basics.IBaseMapper; | ||||||
| import com.hcy.common.entity.warehouse.Warehouse; | import com.hcy.common.entity.warehouse.Warehouse; | ||||||
| import org.apache.ibatis.annotations.Mapper; | import org.apache.ibatis.annotations.Mapper; | ||||||
|  | import org.apache.ibatis.annotations.Select; | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
|  * 仓库管理Mapper |  * 仓库管理Mapper | ||||||
|  */ |  */ | ||||||
| @Mapper | @Mapper | ||||||
| public interface WarehouseMapper extends IBaseMapper<Warehouse> { | public interface WarehouseMapper extends IBaseMapper<Warehouse> { | ||||||
|  | 
 | ||||||
|  |     @Select("select * from la_warehouse where is_delete = 0 and id = #{id}") | ||||||
|  |     Warehouse findWarehouseById(Long id); | ||||||
| } | } | ||||||
|  |  | ||||||
|  | @ -44,6 +44,18 @@ | ||||||
|             <if test="param.orderStatus != null"> |             <if test="param.orderStatus != null"> | ||||||
|                 and find_in_set(lmo.order_status,#{param.orderStatus}) |                 and find_in_set(lmo.order_status,#{param.orderStatus}) | ||||||
|             </if> |             </if> | ||||||
|  |             <if test="param.receiverId != null"> | ||||||
|  |                 and lmo.receiver_id =  #{param.receiverId} | ||||||
|  |             </if> | ||||||
|  |             <if test="param.orderStatusIds != null and param.orderStatusIds != ''"> | ||||||
|  |                 and find_in_set(lmo.order_status,#{param.orderStatusIds}) | ||||||
|  |             </if> | ||||||
|  |             <if test="param.likeWork != null and param.likeWork != ''"> | ||||||
|  |                 and (le.number like concat('%',#{param.likeWork},'%') | ||||||
|  |                 or lmo.order_no like concat('%',#{param.likeWork},'%') | ||||||
|  |                 or lc.client_name like concat('%',#{param.likeWork},'%')) | ||||||
|  | 
 | ||||||
|  |             </if> | ||||||
|         </where> |         </where> | ||||||
|             order by create_time desc |             order by create_time desc | ||||||
|     </select> |     </select> | ||||||
|  |  | ||||||
|  | @ -0,0 +1,22 @@ | ||||||
|  | <?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.hcy.common.mapper.sparePart.SparePartMapper"> | ||||||
|  | 
 | ||||||
|  |     <select id="pageList" resultType="com.hcy.common.dto.SparePartDto"> | ||||||
|  |         SELECT | ||||||
|  |             lsp.*, | ||||||
|  |             lw.warehouse_name as  warehouseName | ||||||
|  |         FROM | ||||||
|  |             la_spare_part AS lsp | ||||||
|  |             LEFT JOIN la_warehouse AS lw ON lw.id = lsp.warehouse_id | ||||||
|  |         <where> | ||||||
|  |             lsp.is_delete = 0 | ||||||
|  |             <if test="param.keywords != null and param.keywords != ''"> | ||||||
|  |                 and (lsp.spare_parts_code like concat('%',#{param.keywords},'%') or | ||||||
|  |                     lsp.spare_parts_name like concat('%',#{param.keywords},'%') or | ||||||
|  |                 lw.warehouse_name like concat('%',#{param.keywords},'%')) | ||||||
|  |             </if> | ||||||
|  |         </where> | ||||||
|  |     </select> | ||||||
|  | 
 | ||||||
|  | </mapper> | ||||||
|  | @ -44,6 +44,18 @@ | ||||||
|             <if test="param.orderStatus != null"> |             <if test="param.orderStatus != null"> | ||||||
|                 and find_in_set(lmo.order_status,#{param.orderStatus}) |                 and find_in_set(lmo.order_status,#{param.orderStatus}) | ||||||
|             </if> |             </if> | ||||||
|  |             <if test="param.receiverId != null"> | ||||||
|  |                 and lmo.receiver_id =  #{param.receiverId} | ||||||
|  |             </if> | ||||||
|  |             <if test="param.orderStatusIds != null and param.orderStatusIds != ''"> | ||||||
|  |                 and find_in_set(lmo.order_status,#{param.orderStatusIds}) | ||||||
|  |             </if> | ||||||
|  |             <if test="param.likeWork != null and param.likeWork != ''"> | ||||||
|  |                 and (le.number like concat('%',#{param.likeWork},'%') | ||||||
|  |                 or lmo.order_no like concat('%',#{param.likeWork},'%') | ||||||
|  |                 or lc.client_name like concat('%',#{param.likeWork},'%')) | ||||||
|  | 
 | ||||||
|  |             </if> | ||||||
|         </where> |         </where> | ||||||
|             order by create_time desc |             order by create_time desc | ||||||
|     </select> |     </select> | ||||||
|  |  | ||||||
|  | @ -35,6 +35,11 @@ public class MaintenanceOrderController { | ||||||
|         return AjaxResult.success(iMaintenanceOrderService.list(maintenanceOrderParam)); |         return AjaxResult.success(iMaintenanceOrderService.list(maintenanceOrderParam)); | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|  |     @GetMapping("/pageList") | ||||||
|  |     public Object pageList(@Validated PageParam pageParam,MaintenanceOrderParam maintenanceOrderParam) { | ||||||
|  |         return AjaxResult.success(iMaintenanceOrderService.pageList(pageParam,maintenanceOrderParam)); | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|     /** |     /** | ||||||
|      * 抢单 |      * 抢单 | ||||||
|      * @param maintenanceOrderParam 参数 |      * @param maintenanceOrderParam 参数 | ||||||
|  | @ -62,9 +67,9 @@ public class MaintenanceOrderController { | ||||||
|      * @param maintenanceOrderParam 参数 |      * @param maintenanceOrderParam 参数 | ||||||
|      * @return Object |      * @return Object | ||||||
|      */ |      */ | ||||||
|     @PostMapping("/checking") |     @PostMapping("/refundOrder") | ||||||
|     public Object checking(@RequestBody MaintenanceOrderParam maintenanceOrderParam) { |     public Object refundOrder(@RequestBody MaintenanceOrderParam maintenanceOrderParam) { | ||||||
|         iMaintenanceOrderService.checking(maintenanceOrderParam); |         iMaintenanceOrderService.refundOrder(maintenanceOrderParam); | ||||||
|         return AjaxResult.success(); |         return AjaxResult.success(); | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|  | @ -74,7 +79,18 @@ public class MaintenanceOrderController { | ||||||
|      * @return Object |      * @return Object | ||||||
|      */ |      */ | ||||||
|     @GetMapping("/detail") |     @GetMapping("/detail") | ||||||
|     public Object detail() { |     public Object detail(Long id) { | ||||||
|         return AjaxResult.success(iMaintenanceOrderService.detail()); |         return AjaxResult.success(iMaintenanceOrderService.detail(id)); | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 服务报价 | ||||||
|  |      * @param maintenanceOrderParam 参数 | ||||||
|  |      * @return Object | ||||||
|  |      */ | ||||||
|  |     @PostMapping("/serviceOfferPrice") | ||||||
|  |     public Object serviceOfferPrice(@RequestBody MaintenanceOrderParam maintenanceOrderParam) { | ||||||
|  |         iMaintenanceOrderService.serviceOfferPrice(maintenanceOrderParam); | ||||||
|  |         return AjaxResult.success(); | ||||||
|     } |     } | ||||||
| } | } | ||||||
|  |  | ||||||
|  | @ -1,14 +1,13 @@ | ||||||
| package com.hcy.admin.controller.order; | package com.hcy.front.controller.order; | ||||||
| 
 | 
 | ||||||
| import com.hcy.admin.config.aop.Log; |  | ||||||
| import com.hcy.admin.service.order.IOrderPartService; |  | ||||||
| import com.hcy.admin.validate.common.PageParam; |  | ||||||
| import com.hcy.admin.validate.order.OrderPartParam; |  | ||||||
| import com.hcy.admin.vo.order.OrderPartDetailVo; |  | ||||||
| import com.hcy.admin.vo.order.OrderPartListVo; |  | ||||||
| import com.hcy.common.core.AjaxResult; | import com.hcy.common.core.AjaxResult; | ||||||
| import com.hcy.common.core.PageResult; | import com.hcy.common.core.PageResult; | ||||||
| import com.hcy.common.validator.annotation.IDMust; | import com.hcy.common.validator.annotation.IDMust; | ||||||
|  | import com.hcy.front.service.order.IOrderSparePartService; | ||||||
|  | import com.hcy.front.validate.PageParam; | ||||||
|  | import com.hcy.front.validate.order.OrderSparePartParam; | ||||||
|  | import com.hcy.front.vo.order.OrderSparePartDetailVo; | ||||||
|  | import com.hcy.front.vo.order.OrderSparePartListVo; | ||||||
| import org.springframework.validation.annotation.Validated; | import org.springframework.validation.annotation.Validated; | ||||||
| import org.springframework.web.bind.annotation.*; | import org.springframework.web.bind.annotation.*; | ||||||
| 
 | 
 | ||||||
|  | @ -20,10 +19,10 @@ import java.util.Map; | ||||||
|  */ |  */ | ||||||
| @RestController | @RestController | ||||||
| @RequestMapping("api/part") | @RequestMapping("api/part") | ||||||
| public class OrderPartController { | public class OrderSparePartController { | ||||||
| 
 | 
 | ||||||
|     @Resource |     @Resource | ||||||
|     IOrderPartService iOrderPartService; |     IOrderSparePartService iOrderSparePartService; | ||||||
| 
 | 
 | ||||||
|     /** |     /** | ||||||
|      * 订单配件列表 |      * 订单配件列表 | ||||||
|  | @ -35,7 +34,7 @@ public class OrderPartController { | ||||||
|     @GetMapping("/list") |     @GetMapping("/list") | ||||||
|     public Object list(@Validated PageParam pageParam, |     public Object list(@Validated PageParam pageParam, | ||||||
|                        @RequestParam Map<String, String> params) { |                        @RequestParam Map<String, String> params) { | ||||||
|         PageResult<OrderPartListVo> list = iOrderPartService.list(pageParam, params); |         PageResult<OrderSparePartListVo> list = iOrderSparePartService.list(pageParam, params); | ||||||
|         return AjaxResult.success(list); |         return AjaxResult.success(list); | ||||||
|     } |     } | ||||||
|     /** |     /** | ||||||
|  | @ -46,46 +45,43 @@ public class OrderPartController { | ||||||
|      */ |      */ | ||||||
|     @GetMapping("/detail") |     @GetMapping("/detail") | ||||||
|     public Object detail(@Validated @IDMust() @RequestParam("id") Integer id) { |     public Object detail(@Validated @IDMust() @RequestParam("id") Integer id) { | ||||||
|         OrderPartDetailVo detail = iOrderPartService.detail(id); |         OrderSparePartDetailVo detail = iOrderSparePartService.detail(id); | ||||||
|         return AjaxResult.success(detail); |         return AjaxResult.success(detail); | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     /** |     /** | ||||||
|      * 订单配件新增 |      * 订单配件新增 | ||||||
|      * |      * | ||||||
|      * @param orderPartParam 参数 |      * @param orderSparePartParam 参数 | ||||||
|      * @return Object |      * @return Object | ||||||
|      */ |      */ | ||||||
|     @Log(title = "订单配件新增") |  | ||||||
|     @PostMapping("/add") |     @PostMapping("/add") | ||||||
|     public Object add(@Validated(value = OrderPartParam.create.class) @RequestBody OrderPartParam orderPartParam) { |     public Object add(@Validated(value = OrderSparePartParam.create.class) @RequestBody OrderSparePartParam orderSparePartParam) { | ||||||
|         iOrderPartService.add(orderPartParam); |         iOrderSparePartService.add(orderSparePartParam); | ||||||
|         return AjaxResult.success(); |         return AjaxResult.success(); | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     /** |     /** | ||||||
|      * 订单配件编辑 |      * 订单配件编辑 | ||||||
|      * |      * | ||||||
|      * @param orderPartParam 参数 |      * @param orderSparePartParam 参数 | ||||||
|      * @return Object |      * @return Object | ||||||
|      */ |      */ | ||||||
|     @Log(title = "订单配件编辑") |  | ||||||
|     @PostMapping("/edit") |     @PostMapping("/edit") | ||||||
|     public Object edit(@Validated(value = OrderPartParam.update.class) @RequestBody OrderPartParam orderPartParam) { |     public Object edit(@Validated(value = OrderSparePartParam.update.class) @RequestBody OrderSparePartParam orderSparePartParam) { | ||||||
|         iOrderPartService.edit(orderPartParam); |         iOrderSparePartService.edit(orderSparePartParam); | ||||||
|         return AjaxResult.success(); |         return AjaxResult.success(); | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     /** |     /** | ||||||
|      * 订单配件删除 |      * 订单配件删除 | ||||||
|      * |      * | ||||||
|      * @param orderPartParam 参数 |      * @param orderSparePartParam 参数 | ||||||
|      * @return Object |      * @return Object | ||||||
|      */ |      */ | ||||||
|     @Log(title = "订单配件删除") |  | ||||||
|     @PostMapping("/del") |     @PostMapping("/del") | ||||||
|     public Object del(@Validated(value = OrderPartParam.delete.class) @RequestBody OrderPartParam orderPartParam) { |     public Object del(@Validated(value = OrderSparePartParam.delete.class) @RequestBody OrderSparePartParam orderSparePartParam) { | ||||||
|         iOrderPartService.del(orderPartParam.getId()); |         iOrderSparePartService.del(orderSparePartParam.getId()); | ||||||
|         return AjaxResult.success(); |         return AjaxResult.success(); | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|  | @ -0,0 +1,51 @@ | ||||||
|  | package com.hcy.front.controller.warehouse; | ||||||
|  | 
 | ||||||
|  | import com.hcy.common.core.AjaxResult; | ||||||
|  | import com.hcy.common.core.PageResult; | ||||||
|  | import com.hcy.common.validator.annotation.IDMust; | ||||||
|  | import com.hcy.front.service.warehouse.ISparePartService; | ||||||
|  | import com.hcy.front.validate.PageParam; | ||||||
|  | import com.hcy.front.validate.warehouse.SparePartParam; | ||||||
|  | import com.hcy.front.vo.warehouse.SparePartDetailVo; | ||||||
|  | import com.hcy.front.vo.warehouse.SparePartListVo; | ||||||
|  | import org.springframework.validation.annotation.Validated; | ||||||
|  | import org.springframework.web.bind.annotation.*; | ||||||
|  | 
 | ||||||
|  | import javax.annotation.Resource; | ||||||
|  | 
 | ||||||
|  | /** | ||||||
|  |  * 备件信息管理 | ||||||
|  |  */ | ||||||
|  | @RestController | ||||||
|  | @RequestMapping("api/sparePart") | ||||||
|  | public class SparePartController { | ||||||
|  | 
 | ||||||
|  |     @Resource | ||||||
|  |     ISparePartService iSparePartService; | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 备件信息列表 | ||||||
|  |      * | ||||||
|  |      * @author hcy | ||||||
|  |      * @param pageParam 分页参数 | ||||||
|  |      * @param param 搜索参数 | ||||||
|  |      * @return Object | ||||||
|  |      */ | ||||||
|  |     @GetMapping("/list") | ||||||
|  |     public Object list(@Validated PageParam pageParam, SparePartParam param) { | ||||||
|  |         PageResult<SparePartListVo> list = iSparePartService.list(pageParam, param); | ||||||
|  |         return AjaxResult.success(list); | ||||||
|  |     } | ||||||
|  |     /** | ||||||
|  |      * 备件信息详情 | ||||||
|  |      * | ||||||
|  |      * @author hcy | ||||||
|  |      * @param id 主键ID | ||||||
|  |      * @return Object | ||||||
|  |      */ | ||||||
|  |     @GetMapping("/detail") | ||||||
|  |     public Object detail(@Validated @IDMust() @RequestParam("id") Integer id) { | ||||||
|  |         SparePartDetailVo detail = iSparePartService.detail(id); | ||||||
|  |         return AjaxResult.success(detail); | ||||||
|  |     } | ||||||
|  | } | ||||||
|  | @ -0,0 +1,102 @@ | ||||||
|  | package com.hcy.front.controller.warehouse; | ||||||
|  | 
 | ||||||
|  | import com.alibaba.fastjson.JSONArray; | ||||||
|  | import com.hcy.common.core.AjaxResult; | ||||||
|  | import com.hcy.common.validator.annotation.IDMust; | ||||||
|  | import com.hcy.front.service.warehouse.IWarehouseService; | ||||||
|  | import com.hcy.front.validate.PageParam; | ||||||
|  | import com.hcy.front.validate.warehouse.WarehouseParam; | ||||||
|  | import com.hcy.front.vo.warehouse.WarehouseDetailVo; | ||||||
|  | import com.hcy.front.vo.warehouse.WarehouseVo; | ||||||
|  | import org.springframework.validation.annotation.Validated; | ||||||
|  | import org.springframework.web.bind.annotation.*; | ||||||
|  | 
 | ||||||
|  | import javax.annotation.Resource; | ||||||
|  | import java.util.Map; | ||||||
|  | 
 | ||||||
|  | /** | ||||||
|  |  * 仓库管理 | ||||||
|  |  */ | ||||||
|  | @RestController | ||||||
|  | @RequestMapping("api/warehouse") | ||||||
|  | public class WarehouseController { | ||||||
|  | 
 | ||||||
|  |     @Resource | ||||||
|  |     IWarehouseService iWarehouseService; | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 仓库管理列表 | ||||||
|  |      * | ||||||
|  |      * @author hcy | ||||||
|  |      * @param params 搜索参数 | ||||||
|  |      * @return Object | ||||||
|  |      */ | ||||||
|  |     @GetMapping("/list") | ||||||
|  |     public Object list(@Validated PageParam pageParam, | ||||||
|  |                        @RequestParam Map<String, String> params) { | ||||||
|  |         JSONArray list = iWarehouseService.list(params); | ||||||
|  |         return AjaxResult.success(list); | ||||||
|  |     } | ||||||
|  |     /** | ||||||
|  |      * 仓库管理详情 | ||||||
|  |      * | ||||||
|  |      * @author hcy | ||||||
|  |      * @param id 主键ID | ||||||
|  |      * @return Object | ||||||
|  |      */ | ||||||
|  |     @GetMapping("/detail") | ||||||
|  |     public Object detail(@Validated @IDMust() @RequestParam("id") Integer id) { | ||||||
|  |         WarehouseDetailVo detail = iWarehouseService.detail(id); | ||||||
|  |         return AjaxResult.success(detail); | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 仓库管理新增 | ||||||
|  |      * | ||||||
|  |      * @author hcy | ||||||
|  |      * @param warehouseParam 参数 | ||||||
|  |      * @return Object | ||||||
|  |      */ | ||||||
|  |     @PostMapping("/add") | ||||||
|  |     public Object add(@Validated(value = WarehouseParam.create.class) @RequestBody WarehouseParam warehouseParam) { | ||||||
|  |         iWarehouseService.add(warehouseParam); | ||||||
|  |         return AjaxResult.success(); | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 仓库管理编辑 | ||||||
|  |      * | ||||||
|  |      * @author hcy | ||||||
|  |      * @param warehouseParam 参数 | ||||||
|  |      * @return Object | ||||||
|  |      */ | ||||||
|  |     @PostMapping("/edit") | ||||||
|  |     public Object edit(@RequestBody WarehouseParam warehouseParam) { | ||||||
|  |         iWarehouseService.edit(warehouseParam); | ||||||
|  |         return AjaxResult.success(); | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 仓库管理删除 | ||||||
|  |      * | ||||||
|  |      * @author hcy | ||||||
|  |      * @param warehouseParam 参数 | ||||||
|  |      * @return Object | ||||||
|  |      */ | ||||||
|  |     @PostMapping("/del") | ||||||
|  |     public Object del(@RequestBody WarehouseParam warehouseParam) { | ||||||
|  |         iWarehouseService.del(warehouseParam.getIds()); | ||||||
|  |         return AjaxResult.success(); | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     //新增接口:传入仓库id时,查询仓库下的所有子仓库及子仓库的内容
 | ||||||
|  |     /** | ||||||
|  |      * 传入仓库id时,查询仓库下的所有子仓库及子仓库的内容 | ||||||
|  |      */ | ||||||
|  |     @GetMapping("/selectWarehouseData") | ||||||
|  |     public Object selectSubcolumnData(WarehouseVo warehouseVo) { | ||||||
|  |         WarehouseVo warehouseVo1 = iWarehouseService.selectWarehouseData(warehouseVo); | ||||||
|  |         return AjaxResult.success(warehouseVo1); | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  | } | ||||||
|  | @ -21,6 +21,8 @@ public interface IMaintenanceOrderService { | ||||||
|      */ |      */ | ||||||
|     List<MaintenanceOrderListVo> list(MaintenanceOrderParam maintenanceOrderParam); |     List<MaintenanceOrderListVo> list(MaintenanceOrderParam maintenanceOrderParam); | ||||||
| 
 | 
 | ||||||
|  |     PageResult<MaintenanceOrderListVo> pageList(PageParam pageParam,MaintenanceOrderParam maintenanceOrderParam); | ||||||
|  | 
 | ||||||
|     /** |     /** | ||||||
|      * 抢单 |      * 抢单 | ||||||
|      * @param maintenanceOrderParam 参数 |      * @param maintenanceOrderParam 参数 | ||||||
|  | @ -37,11 +39,17 @@ public interface IMaintenanceOrderService { | ||||||
|      * 退单 |      * 退单 | ||||||
|      * @param maintenanceOrderParam 参数 |      * @param maintenanceOrderParam 参数 | ||||||
|      */ |      */ | ||||||
|     void checking(MaintenanceOrderParam maintenanceOrderParam); |     void refundOrder(MaintenanceOrderParam maintenanceOrderParam); | ||||||
| 
 | 
 | ||||||
|     /** |     /** | ||||||
|      * 检修工单详情 |      * 检修工单详情 | ||||||
|      * @return MaintenanceOrderDetailVo |      * @return MaintenanceOrderDetailVo | ||||||
|      */ |      */ | ||||||
|     MaintenanceOrderDetailVo detail(); |     MaintenanceOrderDetailVo detail(Long id); | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 退单 | ||||||
|  |      * @param maintenanceOrderParam 参数 | ||||||
|  |      */ | ||||||
|  |     void serviceOfferPrice(MaintenanceOrderParam maintenanceOrderParam); | ||||||
| } | } | ||||||
|  |  | ||||||
|  | @ -0,0 +1,54 @@ | ||||||
|  | package com.hcy.front.service.order; | ||||||
|  | 
 | ||||||
|  | import com.hcy.common.core.PageResult; | ||||||
|  | import com.hcy.front.validate.PageParam; | ||||||
|  | import com.hcy.front.validate.order.OrderSparePartParam; | ||||||
|  | import com.hcy.front.vo.order.OrderSparePartDetailVo; | ||||||
|  | import com.hcy.front.vo.order.OrderSparePartListVo; | ||||||
|  | 
 | ||||||
|  | import java.util.Map; | ||||||
|  | 
 | ||||||
|  | /** | ||||||
|  |  * 订单配件服务接口类 | ||||||
|  |  */ | ||||||
|  | public interface IOrderSparePartService { | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 订单配件列表 | ||||||
|  |      * | ||||||
|  |      * @param pageParam 分页参数 | ||||||
|  |      * @param params 搜索参数 | ||||||
|  |      * @return PageResult<OrderSparePartVo> | ||||||
|  |      */ | ||||||
|  |     PageResult<OrderSparePartListVo> list(PageParam pageParam, Map<String, String> params); | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 订单配件详情 | ||||||
|  |      * | ||||||
|  |      * @param id 主键ID | ||||||
|  |      * @return OrderSparePart | ||||||
|  |      */ | ||||||
|  |     OrderSparePartDetailVo detail(Integer id); | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 订单配件新增 | ||||||
|  |      * | ||||||
|  |      * @param orderSparePartParam 参数 | ||||||
|  |      */ | ||||||
|  |     void add(OrderSparePartParam orderSparePartParam); | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 订单配件编辑 | ||||||
|  |      * | ||||||
|  |      * @param orderSparePartParam 参数 | ||||||
|  |      */ | ||||||
|  |     void edit(OrderSparePartParam orderSparePartParam); | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 订单配件删除 | ||||||
|  |      * | ||||||
|  |      * @param id 主键ID | ||||||
|  |      */ | ||||||
|  |     void del(Long id); | ||||||
|  | 
 | ||||||
|  | } | ||||||
|  | @ -7,10 +7,12 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | ||||||
| import com.hcy.common.constant.GlobalConstant; | import com.hcy.common.constant.GlobalConstant; | ||||||
| import com.hcy.common.core.PageResult; | import com.hcy.common.core.PageResult; | ||||||
| import com.hcy.common.dto.order.MaintenanceOrderDto; | import com.hcy.common.dto.order.MaintenanceOrderDto; | ||||||
|  | import com.hcy.common.dto.order.OrderSparePart; | ||||||
| import com.hcy.common.entity.client.Client; | import com.hcy.common.entity.client.Client; | ||||||
| import com.hcy.common.entity.client.Equipment; | import com.hcy.common.entity.client.Equipment; | ||||||
| import com.hcy.common.entity.fault.Fault; | import com.hcy.common.entity.fault.Fault; | ||||||
| import com.hcy.common.entity.order.MaintenanceOrder; | import com.hcy.common.entity.order.MaintenanceOrder; | ||||||
|  | import com.hcy.common.entity.sparePart.SparePart; | ||||||
| import com.hcy.common.entity.system.SystemAuthAdmin; | import com.hcy.common.entity.system.SystemAuthAdmin; | ||||||
| import com.hcy.common.entity.user.User; | import com.hcy.common.entity.user.User; | ||||||
| import com.hcy.common.enums.order.MaintenanceOrderStatusEnum; | import com.hcy.common.enums.order.MaintenanceOrderStatusEnum; | ||||||
|  | @ -20,20 +22,24 @@ import com.hcy.common.mapper.client.ClientMapper; | ||||||
| import com.hcy.common.mapper.client.EquipmentMapper; | import com.hcy.common.mapper.client.EquipmentMapper; | ||||||
| import com.hcy.common.mapper.fault.FaultMapper; | import com.hcy.common.mapper.fault.FaultMapper; | ||||||
| import com.hcy.common.mapper.order.MaintenanceOrderMapper; | import com.hcy.common.mapper.order.MaintenanceOrderMapper; | ||||||
|  | import com.hcy.common.mapper.sparePart.SparePartMapper; | ||||||
| import com.hcy.common.mapper.system.SystemAuthAdminMapper; | import com.hcy.common.mapper.system.SystemAuthAdminMapper; | ||||||
| import com.hcy.common.mapper.user.UserMapper; | import com.hcy.common.mapper.user.UserMapper; | ||||||
|  | import com.hcy.common.utils.StringUtil; | ||||||
| import com.hcy.common.utils.ToolsUtil; | import com.hcy.common.utils.ToolsUtil; | ||||||
| import com.hcy.front.FrontThreadLocal; | import com.hcy.front.FrontThreadLocal; | ||||||
| import com.hcy.front.service.order.IMaintenanceOrderService; | import com.hcy.front.service.order.IMaintenanceOrderService; | ||||||
| import com.hcy.front.service.region.IDevRegionService; | import com.hcy.front.service.region.IDevRegionService; | ||||||
| import com.hcy.front.validate.PageParam; | import com.hcy.front.validate.PageParam; | ||||||
| import com.hcy.front.validate.order.MaintenanceOrderParam; | import com.hcy.front.validate.order.MaintenanceOrderParam; | ||||||
|  | import com.hcy.front.validate.warehouse.SparePartParam; | ||||||
| import com.hcy.front.vo.order.MaintenanceOrderDetailVo; | import com.hcy.front.vo.order.MaintenanceOrderDetailVo; | ||||||
| import com.hcy.front.vo.order.MaintenanceOrderListVo; | import com.hcy.front.vo.order.MaintenanceOrderListVo; | ||||||
| import com.hcy.front.vo.order.OrderStaffVo; | import com.hcy.front.vo.order.OrderStaffVo; | ||||||
| import org.springframework.beans.BeanUtils; | import org.springframework.beans.BeanUtils; | ||||||
| import org.springframework.stereotype.Service; | import org.springframework.stereotype.Service; | ||||||
| import org.springframework.util.Assert; | import org.springframework.util.Assert; | ||||||
|  | import org.springframework.util.StringUtils; | ||||||
| 
 | 
 | ||||||
| import javax.annotation.Resource; | import javax.annotation.Resource; | ||||||
| import java.math.BigDecimal; | import java.math.BigDecimal; | ||||||
|  | @ -63,6 +69,12 @@ public class MaintenanceOrderServiceImpl implements IMaintenanceOrderService { | ||||||
|     @Resource |     @Resource | ||||||
|     UserMapper userMapper; |     UserMapper userMapper; | ||||||
| 
 | 
 | ||||||
|  |     @Resource | ||||||
|  |     FaultMapper faultMapper; | ||||||
|  | 
 | ||||||
|  |     @Resource | ||||||
|  |     SparePartMapper sparePartMapper; | ||||||
|  | 
 | ||||||
|     private final DecimalFormat df = new DecimalFormat ("#.#"); |     private final DecimalFormat df = new DecimalFormat ("#.#"); | ||||||
| 
 | 
 | ||||||
|     /** |     /** | ||||||
|  | @ -76,25 +88,43 @@ public class MaintenanceOrderServiceImpl implements IMaintenanceOrderService { | ||||||
|         MaintenanceOrderDto maintenanceOrderDto = new MaintenanceOrderDto(); |         MaintenanceOrderDto maintenanceOrderDto = new MaintenanceOrderDto(); | ||||||
|         BeanUtils.copyProperties(maintenanceOrderParam,maintenanceOrderDto); |         BeanUtils.copyProperties(maintenanceOrderParam,maintenanceOrderDto); | ||||||
|         //默认查询订单状态
 |         //默认查询订单状态
 | ||||||
|         if(maintenanceOrderParam.getOrderStatus() == null){ | 
 | ||||||
|             maintenanceOrderParam.setOrderStatus("1,2,7,8"); |  | ||||||
|         } |  | ||||||
|         List<MaintenanceOrderDto> maintenanceOrderList = maintenanceOrderMapper.list(maintenanceOrderDto); |         List<MaintenanceOrderDto> maintenanceOrderList = maintenanceOrderMapper.list(maintenanceOrderDto); | ||||||
|  |         SystemAuthAdmin systemAuthAdmin = systemAuthAdminMapper.findSystemAuthAdminByUserId(FrontThreadLocal.getUserId()); | ||||||
| 
 | 
 | ||||||
|         List<MaintenanceOrderListVo> returnData = new LinkedList<>(); |         List<MaintenanceOrderListVo> returnData = new LinkedList<>(); | ||||||
|         for (MaintenanceOrderDto item : maintenanceOrderList) { |         for (MaintenanceOrderDto item : maintenanceOrderList) { | ||||||
| 
 | 
 | ||||||
|  |             if(maintenanceOrderParam.getQueryType() == MaintenanceOrderStatusEnum.NEAREST_TO_ME.getStatus()){ | ||||||
|                 //判断抢单距离大于订单距离则返回订单
 |                 //判断抢单距离大于订单距离则返回订单
 | ||||||
|                 double distance = ToolsUtil.getDistance(item.getLongitude(), item.getLatitude() |                 double distance = ToolsUtil.getDistance(item.getLongitude(), item.getLatitude() | ||||||
|                         , maintenanceOrderParam.getLongitude(), maintenanceOrderParam.getLatitude()); |                         , maintenanceOrderParam.getLongitude(), maintenanceOrderParam.getLatitude()); | ||||||
|  | 
 | ||||||
|  |                 if(item.getReceiverType() == OrderStateEnum.REGIONAL_DISPATCH.getStatus()){ | ||||||
|  |                     if(item.getEquipmentProvinceId().equals(systemAuthAdmin.getProvinceId()) && | ||||||
|  |                             item.getEquipmentCityId().equals(systemAuthAdmin.getCityId()) && | ||||||
|  |                             item.getEquipmentDistrictId().equals(systemAuthAdmin.getDistrictId()) ){ | ||||||
|  | 
 | ||||||
|  |                         // 计算距离
 | ||||||
|  |                         MaintenanceOrderListVo vo = new MaintenanceOrderListVo(); | ||||||
|  |                         BeanUtils.copyProperties(item, vo); | ||||||
|  |                         vo.setDistance(distance); | ||||||
|  |                         returnData.add(vo); | ||||||
|  |                     } | ||||||
|  |                 }else{ | ||||||
|                     if(item.getOrderDistance().compareTo(BigDecimal.valueOf((distance / 1000))) >= 0){ |                     if(item.getOrderDistance().compareTo(BigDecimal.valueOf((distance / 1000))) >= 0){ | ||||||
|                         // 计算距离
 |                         // 计算距离
 | ||||||
|                         MaintenanceOrderListVo vo = new MaintenanceOrderListVo(); |                         MaintenanceOrderListVo vo = new MaintenanceOrderListVo(); | ||||||
|                         BeanUtils.copyProperties(item, vo); |                         BeanUtils.copyProperties(item, vo); | ||||||
|                 vo.setDistance(String.valueOf(distance)); |                         vo.setDistance(distance); | ||||||
|  |                         returnData.add(vo); | ||||||
|  |                     } | ||||||
|  |                 } | ||||||
|  |             }else{ | ||||||
|  |                 MaintenanceOrderListVo vo = new MaintenanceOrderListVo(); | ||||||
|  |                 BeanUtils.copyProperties(item, vo); | ||||||
|                 returnData.add(vo); |                 returnData.add(vo); | ||||||
|             } |             } | ||||||
| 
 |  | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|         if(maintenanceOrderParam.getQueryType() == MaintenanceOrderStatusEnum.NEAREST_TO_ME.getStatus()){ |         if(maintenanceOrderParam.getQueryType() == MaintenanceOrderStatusEnum.NEAREST_TO_ME.getStatus()){ | ||||||
|  | @ -105,12 +135,14 @@ public class MaintenanceOrderServiceImpl implements IMaintenanceOrderService { | ||||||
| 
 | 
 | ||||||
|             //将米数转换为km
 |             //将米数转换为km
 | ||||||
|             for (MaintenanceOrderListVo maintenanceOrderListVo : returnData) { |             for (MaintenanceOrderListVo maintenanceOrderListVo : returnData) { | ||||||
|                 double distance = Double.parseDouble(maintenanceOrderListVo.getDistance()); |                 if(maintenanceOrderListVo.getDistance() != null){ | ||||||
|  |                     double distance = maintenanceOrderListVo.getDistance(); | ||||||
|                     if(distance < 1000){ |                     if(distance < 1000){ | ||||||
|                     maintenanceOrderListVo.setDistance(distance + "米"); |                         maintenanceOrderListVo.setPracticalDistance(df.format(distance) + "米"); | ||||||
|                     }else{ |                     }else{ | ||||||
|                         double km = distance / 1000; |                         double km = distance / 1000; | ||||||
|                     maintenanceOrderListVo.setDistance(df.format(km) + "km"); |                         maintenanceOrderListVo.setPracticalDistance(df.format(km) + "km"); | ||||||
|  |                     } | ||||||
|                 } |                 } | ||||||
|             } |             } | ||||||
|         } |         } | ||||||
|  | @ -118,12 +150,35 @@ public class MaintenanceOrderServiceImpl implements IMaintenanceOrderService { | ||||||
|         return returnData; |         return returnData; | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|  |     @Override | ||||||
|  |     public PageResult<MaintenanceOrderListVo> pageList(PageParam pageParam, MaintenanceOrderParam maintenanceOrderParam) { | ||||||
|  |         MaintenanceOrderDto maintenanceOrderDto = new MaintenanceOrderDto(); | ||||||
|  |         BeanUtils.copyProperties(maintenanceOrderParam,maintenanceOrderDto); | ||||||
|  |         maintenanceOrderDto.setReceiverId(FrontThreadLocal.getUserId().longValue()); | ||||||
|  |         if(maintenanceOrderParam.getOrderStatus() == null){ | ||||||
|  |             maintenanceOrderDto.setOrderStatusIds("1,2,7,8"); | ||||||
|  |         } | ||||||
|  | 
 | ||||||
|  |         List<MaintenanceOrderListVo> returnData = new LinkedList<>(); | ||||||
|  | 
 | ||||||
|  |         Page<MaintenanceOrderDto> page = maintenanceOrderMapper.list( | ||||||
|  |                 new Page<>(pageParam.getPageNo(), pageParam.getPageSize()),maintenanceOrderDto); | ||||||
|  |         for (MaintenanceOrderDto item : page.getRecords()) { | ||||||
|  |             MaintenanceOrderListVo vo = new MaintenanceOrderListVo(); | ||||||
|  |             BeanUtils.copyProperties(item, vo); | ||||||
|  |             returnData.add(vo); | ||||||
|  |         } | ||||||
|  | 
 | ||||||
|  |         return PageResult.iPageHandle(page.getTotal(), page.getCurrent(), page.getSize(), returnData); | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|     @Override |     @Override | ||||||
|     public void grabTheOrder(MaintenanceOrderParam maintenanceOrderParam) { |     public void grabTheOrder(MaintenanceOrderParam maintenanceOrderParam) { | ||||||
|         MaintenanceOrder maintenanceOrder = maintenanceOrderMapper.findMaintenanceOrderById(maintenanceOrderParam.getId()); |         MaintenanceOrder maintenanceOrder = maintenanceOrderMapper.findMaintenanceOrderById(maintenanceOrderParam.getId()); | ||||||
|         Assert.notNull(maintenanceOrder, "数据不存在"); |         Assert.notNull(maintenanceOrder, "数据不存在"); | ||||||
| 
 | 
 | ||||||
|         if(maintenanceOrder.getOrderStatus() == MaintenanceOrderStatusEnum.WAITING_LIST.getStatus()){ |         if(maintenanceOrder.getOrderStatus() == MaintenanceOrderStatusEnum.WAITING_LIST.getStatus() | ||||||
|  |                 && maintenanceOrder.getReceiverId() == null){ | ||||||
|             maintenanceOrder.setReceiverId(FrontThreadLocal.getUserId().longValue()); |             maintenanceOrder.setReceiverId(FrontThreadLocal.getUserId().longValue()); | ||||||
|             maintenanceOrder.setOrderStatus(MaintenanceOrderStatusEnum.CHECKING.getStatus()); |             maintenanceOrder.setOrderStatus(MaintenanceOrderStatusEnum.CHECKING.getStatus()); | ||||||
|             maintenanceOrder.setReceiverTime(new Date()); |             maintenanceOrder.setReceiverTime(new Date()); | ||||||
|  | @ -149,26 +204,34 @@ public class MaintenanceOrderServiceImpl implements IMaintenanceOrderService { | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     @Override |     @Override | ||||||
|     public void checking(MaintenanceOrderParam maintenanceOrderParam) { |     public void refundOrder(MaintenanceOrderParam maintenanceOrderParam) { | ||||||
|         MaintenanceOrder maintenanceOrder = maintenanceOrderMapper.findMaintenanceOrderById(maintenanceOrderParam.getId()); |         MaintenanceOrder maintenanceOrder = maintenanceOrderMapper.findMaintenanceOrderById(maintenanceOrderParam.getId()); | ||||||
|         Assert.notNull(maintenanceOrder, "数据不存在"); |         Assert.notNull(maintenanceOrder, "数据不存在"); | ||||||
|         Assert.notNull(maintenanceOrder.getCancelCause(), "接单原因不可为空"); |         Assert.notNull(maintenanceOrderParam.getCancelCause(), "退单原因不可为空"); | ||||||
| 
 | 
 | ||||||
|         if(maintenanceOrder.getOrderStatus() == MaintenanceOrderStatusEnum.CHECKING.getStatus()){ |         if(maintenanceOrder.getOrderStatus() == MaintenanceOrderStatusEnum.CHECKING.getStatus() || | ||||||
|             maintenanceOrder.setCancelOrderTime(new Date()); |                 maintenanceOrder.getOrderStatus() == MaintenanceOrderStatusEnum.PENDING_ORDER.getStatus()){ | ||||||
|  | 
 | ||||||
|  |             if(maintenanceOrder.getRepairWorkOrderFlow() == OrderStateEnum.WORK_ORDER_TANK.getStatus()){ | ||||||
|  |                 maintenanceOrder.setOrderStatus(MaintenanceOrderStatusEnum.WAITING_LIST.getStatus()); | ||||||
|  |                 maintenanceOrder.setReceiverId(null); | ||||||
|  |             }else{ | ||||||
|                 maintenanceOrder.setOrderStatus(MaintenanceOrderStatusEnum.CHARGEBACK.getStatus()); |                 maintenanceOrder.setOrderStatus(MaintenanceOrderStatusEnum.CHARGEBACK.getStatus()); | ||||||
|  |             } | ||||||
|  |             maintenanceOrder.setCancelOrderTime(new Date()); | ||||||
|             maintenanceOrder.setCancelCause(maintenanceOrderParam.getCancelCause()); |             maintenanceOrder.setCancelCause(maintenanceOrderParam.getCancelCause()); | ||||||
|  | 
 | ||||||
|             maintenanceOrderMapper.updateById(maintenanceOrder); |             maintenanceOrderMapper.updateById(maintenanceOrder); | ||||||
|         }else{ |         }else{ | ||||||
|             throw new OperateException("订单状态不正确"); |             throw new OperateException("当前订单状态不可退单"); | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|     @Override |     @Override | ||||||
|     public MaintenanceOrderDetailVo detail() { |     public MaintenanceOrderDetailVo detail(Long id) { | ||||||
|         Integer userId = FrontThreadLocal.getUserId(); |         MaintenanceOrder maintenanceOrder = maintenanceOrderMapper.findMaintenanceOrderById(id); | ||||||
| 
 |  | ||||||
|         MaintenanceOrder maintenanceOrder = maintenanceOrderMapper.findMaintenanceOrderById(userId.longValue()); |  | ||||||
|         Assert.notNull(maintenanceOrder, "数据不存在"); |         Assert.notNull(maintenanceOrder, "数据不存在"); | ||||||
| 
 | 
 | ||||||
|         MaintenanceOrderDetailVo vo = new MaintenanceOrderDetailVo(); |         MaintenanceOrderDetailVo vo = new MaintenanceOrderDetailVo(); | ||||||
|  | @ -182,6 +245,10 @@ public class MaintenanceOrderServiceImpl implements IMaintenanceOrderService { | ||||||
|         Equipment equipment = equipmentMapper.selectById(maintenanceOrder.getEquipmentId()); |         Equipment equipment = equipmentMapper.selectById(maintenanceOrder.getEquipmentId()); | ||||||
|         vo.setEquipment(equipment); |         vo.setEquipment(equipment); | ||||||
| 
 | 
 | ||||||
|  |         //设置故障信息
 | ||||||
|  |         Fault fault = faultMapper.findFaultById(maintenanceOrder.getFaultId()); | ||||||
|  |         vo.setFaultName(fault.getName()); | ||||||
|  | 
 | ||||||
|         //设置接收人姓名
 |         //设置接收人姓名
 | ||||||
|         SystemAuthAdmin systemAuthAdmin = systemAuthAdminMapper.selectById(maintenanceOrder.getCreatorId()); |         SystemAuthAdmin systemAuthAdmin = systemAuthAdminMapper.selectById(maintenanceOrder.getCreatorId()); | ||||||
|         vo.setCreatorName(systemAuthAdmin.getNickname()); |         vo.setCreatorName(systemAuthAdmin.getNickname()); | ||||||
|  | @ -194,4 +261,27 @@ public class MaintenanceOrderServiceImpl implements IMaintenanceOrderService { | ||||||
| 
 | 
 | ||||||
|         return vo; |         return vo; | ||||||
|     } |     } | ||||||
|  | 
 | ||||||
|  |     @Override | ||||||
|  |     public void serviceOfferPrice(MaintenanceOrderParam maintenanceOrderParam) { | ||||||
|  |         MaintenanceOrder maintenanceOrder = maintenanceOrderMapper.findMaintenanceOrderById(maintenanceOrderParam.getId()); | ||||||
|  |         Assert.notNull(maintenanceOrder, "数据不存在"); | ||||||
|  | 
 | ||||||
|  |         maintenanceOrder.setFaultDescription(maintenanceOrderParam.getFaultDescription()); | ||||||
|  |         maintenanceOrder.setFaultImg(maintenanceOrderParam.getFaultImg()); | ||||||
|  | 
 | ||||||
|  |         Client client = clientMapper.findClientById(maintenanceOrder.getClientId()); | ||||||
|  |         for (SparePartParam item : maintenanceOrderParam.getSparePartParams()) { | ||||||
|  |             SparePart sparePart = sparePartMapper.findSparePart(item.getId()); | ||||||
|  | 
 | ||||||
|  |             OrderSparePart orderSparePart = new OrderSparePart(); | ||||||
|  |             BeanUtils.copyProperties(sparePart, orderSparePart); | ||||||
|  | 
 | ||||||
|  |             orderSparePart.setSparePartsId(item.getId()); | ||||||
|  | 
 | ||||||
|  |         } | ||||||
|  | 
 | ||||||
|  |         maintenanceOrderMapper.updateById(maintenanceOrder); | ||||||
|  | 
 | ||||||
|  |     } | ||||||
| } | } | ||||||
|  |  | ||||||
|  | @ -0,0 +1,152 @@ | ||||||
|  | package com.hcy.front.service.order.impl; | ||||||
|  | 
 | ||||||
|  | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | ||||||
|  | import com.baomidou.mybatisplus.core.metadata.IPage; | ||||||
|  | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | ||||||
|  | import com.hcy.common.core.PageResult; | ||||||
|  | import com.hcy.common.dto.order.OrderSparePart; | ||||||
|  | import com.hcy.common.mapper.order.OrderSparePartMapper; | ||||||
|  | import com.hcy.front.service.order.IOrderSparePartService; | ||||||
|  | import com.hcy.front.validate.PageParam; | ||||||
|  | import com.hcy.front.validate.order.OrderSparePartParam; | ||||||
|  | import com.hcy.front.vo.order.OrderSparePartDetailVo; | ||||||
|  | import com.hcy.front.vo.order.OrderSparePartListVo; | ||||||
|  | import org.springframework.beans.BeanUtils; | ||||||
|  | import org.springframework.stereotype.Service; | ||||||
|  | import org.springframework.util.Assert; | ||||||
|  | 
 | ||||||
|  | import javax.annotation.Resource; | ||||||
|  | import java.util.*; | ||||||
|  | 
 | ||||||
|  | /** | ||||||
|  |  * 订单配件实现类 | ||||||
|  |  */ | ||||||
|  | @Service | ||||||
|  | public class OrderSparePartServiceImpl implements IOrderSparePartService { | ||||||
|  |          | ||||||
|  |     @Resource | ||||||
|  |     OrderSparePartMapper orderSparePartMapper; | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 订单配件列表 | ||||||
|  |      * | ||||||
|  |      * @param pageParam 分页参数 | ||||||
|  |      * @param params 搜索参数 | ||||||
|  |      * @return PageResult<OrderSparePartListVo> | ||||||
|  |      */ | ||||||
|  |     @Override | ||||||
|  |     public PageResult<OrderSparePartListVo> list(PageParam pageParam, Map<String, String> params) { | ||||||
|  |         Integer page  = pageParam.getPageNo(); | ||||||
|  |         Integer limit = pageParam.getPageSize(); | ||||||
|  | 
 | ||||||
|  |         QueryWrapper<OrderSparePart> queryWrapper = new QueryWrapper<>(); | ||||||
|  |         queryWrapper.eq("is_delete", 0); | ||||||
|  |         queryWrapper.orderByDesc("id"); | ||||||
|  | 
 | ||||||
|  |         orderSparePartMapper.setSearch(queryWrapper, params, new String[]{ | ||||||
|  |             "=:sparePartsId@spare_parts_id:long", | ||||||
|  |             "=:sparePartsCode@spare_parts_code:str", | ||||||
|  |             "like:sparePartsName@spare_parts_name:str", | ||||||
|  |             "like:warehouseName@warehouse_name:str", | ||||||
|  |             "=:specificationsModel@specifications_model:str", | ||||||
|  |             "=:unit:str", | ||||||
|  |             "=:price:str", | ||||||
|  |             "=:quantity:long", | ||||||
|  |             "=:totalPrice@total_price:str", | ||||||
|  |         }); | ||||||
|  | 
 | ||||||
|  |         IPage<OrderSparePart> iPage = orderSparePartMapper.selectPage(new Page<>(page, limit), queryWrapper); | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  |         return PageResult.iPageHandle(iPage.getTotal(), iPage.getCurrent(), iPage.getSize(), null); | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 订单配件详情 | ||||||
|  |      * | ||||||
|  |      * @param id 主键参数 | ||||||
|  |      * @return OrderSparePart | ||||||
|  |      */ | ||||||
|  |     @Override | ||||||
|  |     public OrderSparePartDetailVo detail(Integer id) { | ||||||
|  |         OrderSparePart model = orderSparePartMapper.selectOne( | ||||||
|  |                 new QueryWrapper<OrderSparePart>() | ||||||
|  |                     .eq("id", id) | ||||||
|  |                     .eq("is_delete", 0) | ||||||
|  |                     .last("limit 1")); | ||||||
|  | 
 | ||||||
|  |         Assert.notNull(model, "数据不存在"); | ||||||
|  | 
 | ||||||
|  |         OrderSparePartDetailVo vo = new OrderSparePartDetailVo(); | ||||||
|  |         BeanUtils.copyProperties(model, vo); | ||||||
|  |         return vo; | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 订单配件新增 | ||||||
|  |      * | ||||||
|  |      * @param orderSparePartParam 参数 | ||||||
|  |      */ | ||||||
|  |     @Override | ||||||
|  |     public void add(OrderSparePartParam orderSparePartParam) { | ||||||
|  |         OrderSparePart model = new OrderSparePart(); | ||||||
|  |         model.setSparePartsId(orderSparePartParam.getSparePartsId()); | ||||||
|  |         model.setSparePartsCode(orderSparePartParam.getSparePartsCode()); | ||||||
|  |         model.setSparePartsName(orderSparePartParam.getSparePartsName()); | ||||||
|  |         model.setWarehouseName(orderSparePartParam.getWarehouseName()); | ||||||
|  |         model.setSpecificationsModel(orderSparePartParam.getSpecificationsModel()); | ||||||
|  |         model.setUnit(orderSparePartParam.getUnit()); | ||||||
|  |         model.setPrice(orderSparePartParam.getPrice()); | ||||||
|  |         model.setQuantity(orderSparePartParam.getQuantity()); | ||||||
|  |         model.setTotalPrice(orderSparePartParam.getTotalPrice()); | ||||||
|  |         orderSparePartMapper.insert(model); | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 订单配件编辑 | ||||||
|  |      * | ||||||
|  |      * @param orderSparePartParam 参数 | ||||||
|  |      */ | ||||||
|  |     @Override | ||||||
|  |     public void edit(OrderSparePartParam orderSparePartParam) { | ||||||
|  |         OrderSparePart model = orderSparePartMapper.selectOne( | ||||||
|  |                 new QueryWrapper<OrderSparePart>() | ||||||
|  |                     .eq("id",  orderSparePartParam.getId()) | ||||||
|  |                     .eq("is_delete", 0) | ||||||
|  |                     .last("limit 1")); | ||||||
|  | 
 | ||||||
|  |         Assert.notNull(model, "数据不存在!"); | ||||||
|  | 
 | ||||||
|  |         model.setId(orderSparePartParam.getId()); | ||||||
|  |         model.setSparePartsId(orderSparePartParam.getSparePartsId()); | ||||||
|  |         model.setSparePartsCode(orderSparePartParam.getSparePartsCode()); | ||||||
|  |         model.setSparePartsName(orderSparePartParam.getSparePartsName()); | ||||||
|  |         model.setWarehouseName(orderSparePartParam.getWarehouseName()); | ||||||
|  |         model.setSpecificationsModel(orderSparePartParam.getSpecificationsModel()); | ||||||
|  |         model.setUnit(orderSparePartParam.getUnit()); | ||||||
|  |         model.setPrice(orderSparePartParam.getPrice()); | ||||||
|  |         model.setQuantity(orderSparePartParam.getQuantity()); | ||||||
|  |         model.setTotalPrice(orderSparePartParam.getTotalPrice()); | ||||||
|  |         orderSparePartMapper.updateById(model); | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 订单配件删除 | ||||||
|  |      * | ||||||
|  |      * @param id 主键ID | ||||||
|  |      */ | ||||||
|  |     @Override | ||||||
|  |     public void del(Long id) { | ||||||
|  |         OrderSparePart model = orderSparePartMapper.selectOne( | ||||||
|  |                 new QueryWrapper<OrderSparePart>() | ||||||
|  |                     .eq("id", id) | ||||||
|  |                     .eq("is_delete", 0) | ||||||
|  |                     .last("limit 1")); | ||||||
|  | 
 | ||||||
|  |         Assert.notNull(model, "数据不存在!"); | ||||||
|  | 
 | ||||||
|  |         model.setIsDelete(1); | ||||||
|  |         orderSparePartMapper.updateById(model); | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  | } | ||||||
|  | @ -0,0 +1,35 @@ | ||||||
|  | package com.hcy.front.service.warehouse; | ||||||
|  | 
 | ||||||
|  | import com.hcy.common.core.PageResult; | ||||||
|  | import com.hcy.front.validate.PageParam; | ||||||
|  | import com.hcy.front.validate.warehouse.SparePartParam; | ||||||
|  | import com.hcy.front.vo.warehouse.SparePartDetailVo; | ||||||
|  | import com.hcy.front.vo.warehouse.SparePartListVo; | ||||||
|  | 
 | ||||||
|  | import java.util.List; | ||||||
|  | import java.util.Map; | ||||||
|  | 
 | ||||||
|  | /** | ||||||
|  |  * 备件信息服务接口类 | ||||||
|  |  */ | ||||||
|  | public interface ISparePartService { | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 备件信息列表 | ||||||
|  |      * | ||||||
|  |      * @author hcy | ||||||
|  |      * @param pageParam 分页参数 | ||||||
|  |      * @param param 搜索参数 | ||||||
|  |      * @return PageResult<SparePartVo> | ||||||
|  |      */ | ||||||
|  |     PageResult<SparePartListVo> list(PageParam pageParam, SparePartParam param); | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 备件信息详情 | ||||||
|  |      * | ||||||
|  |      * @author hcy | ||||||
|  |      * @param id 主键ID | ||||||
|  |      * @return SparePart | ||||||
|  |      */ | ||||||
|  |     SparePartDetailVo detail(Integer id); | ||||||
|  | } | ||||||
|  | @ -0,0 +1,59 @@ | ||||||
|  | package com.hcy.front.service.warehouse; | ||||||
|  | 
 | ||||||
|  | import com.alibaba.fastjson.JSONArray; | ||||||
|  | import com.hcy.front.validate.warehouse.WarehouseParam; | ||||||
|  | import com.hcy.front.vo.warehouse.WarehouseDetailVo; | ||||||
|  | import com.hcy.front.vo.warehouse.WarehouseVo; | ||||||
|  | 
 | ||||||
|  | import java.util.Map; | ||||||
|  | 
 | ||||||
|  | /** | ||||||
|  |  * 仓库管理服务接口类 | ||||||
|  |  */ | ||||||
|  | public interface IWarehouseService { | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 仓库管理列表 | ||||||
|  |      * | ||||||
|  |      * @author hcy | ||||||
|  |      * @param params 搜索参数 | ||||||
|  |      * @return JSONArray | ||||||
|  |     */ | ||||||
|  |     JSONArray list(Map<String, String> params); | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 仓库管理详情 | ||||||
|  |      * | ||||||
|  |      * @author hcy | ||||||
|  |      * @param id 主键ID | ||||||
|  |      * @return Warehouse | ||||||
|  |      */ | ||||||
|  |     WarehouseDetailVo detail(Integer id); | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 仓库管理新增 | ||||||
|  |      * | ||||||
|  |      * @author hcy | ||||||
|  |      * @param warehouseParam 参数 | ||||||
|  |      */ | ||||||
|  |     void add(WarehouseParam warehouseParam); | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 仓库管理编辑 | ||||||
|  |      * | ||||||
|  |      * @author hcy | ||||||
|  |      * @param warehouseParam 参数 | ||||||
|  |      */ | ||||||
|  |     void edit(WarehouseParam warehouseParam); | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 仓库管理删除 | ||||||
|  |      * | ||||||
|  |      * @author hcy | ||||||
|  |      * @param ids | ||||||
|  |      */ | ||||||
|  |     void del(Long[] ids); | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  |     WarehouseVo selectWarehouseData(WarehouseVo warehouseVo); | ||||||
|  | } | ||||||
|  | @ -0,0 +1,124 @@ | ||||||
|  | package com.hcy.front.service.warehouse.impl; | ||||||
|  | 
 | ||||||
|  | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | ||||||
|  | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | ||||||
|  | import com.baomidou.mybatisplus.core.metadata.IPage; | ||||||
|  | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | ||||||
|  | import com.hcy.common.constant.GlobalConstant; | ||||||
|  | import com.hcy.common.core.PageResult; | ||||||
|  | import com.hcy.common.dto.SparePartDto; | ||||||
|  | import com.hcy.common.entity.client.Client; | ||||||
|  | import com.hcy.common.entity.client.ClientContacts; | ||||||
|  | import com.hcy.common.entity.sparePart.SparePart; | ||||||
|  | import com.hcy.common.entity.warehouse.Warehouse; | ||||||
|  | import com.hcy.common.exception.OperateException; | ||||||
|  | import com.hcy.common.mapper.client.ClientContactsMapper; | ||||||
|  | import com.hcy.common.mapper.client.ClientMapper; | ||||||
|  | import com.hcy.common.mapper.sparePart.SparePartMapper; | ||||||
|  | import com.hcy.common.mapper.warehouse.WarehouseMapper; | ||||||
|  | import com.hcy.common.utils.StringUtil; | ||||||
|  | import com.hcy.common.utils.TimeUtil; | ||||||
|  | import com.hcy.front.FrontThreadLocal; | ||||||
|  | import com.hcy.front.service.warehouse.ISparePartService; | ||||||
|  | import com.hcy.front.validate.PageParam; | ||||||
|  | import com.hcy.front.validate.warehouse.SparePartParam; | ||||||
|  | import com.hcy.front.vo.warehouse.SparePartDetailVo; | ||||||
|  | import com.hcy.front.vo.warehouse.SparePartListVo; | ||||||
|  | import org.apache.commons.lang3.StringUtils; | ||||||
|  | import org.springframework.beans.BeanUtils; | ||||||
|  | import org.springframework.stereotype.Service; | ||||||
|  | import org.springframework.util.Assert; | ||||||
|  | 
 | ||||||
|  | import javax.annotation.Resource; | ||||||
|  | import java.math.BigDecimal; | ||||||
|  | import java.util.*; | ||||||
|  | 
 | ||||||
|  | /** | ||||||
|  |  * 备件信息实现类 | ||||||
|  |  */ | ||||||
|  | @Service | ||||||
|  | public class SparePartServiceImpl implements ISparePartService { | ||||||
|  |          | ||||||
|  |     @Resource | ||||||
|  |     SparePartMapper sparePartMapper; | ||||||
|  | 
 | ||||||
|  |     @Resource | ||||||
|  |     WarehouseMapper warehouseMapper; | ||||||
|  | 
 | ||||||
|  |     @Resource | ||||||
|  |     ClientMapper clientMapper; | ||||||
|  | 
 | ||||||
|  |     @Resource | ||||||
|  |     ClientContactsMapper clientContactsMapper; | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 备件信息列表 | ||||||
|  |      * | ||||||
|  |      * @author hcy | ||||||
|  |      * @param pageParam 分页参数 | ||||||
|  |      * @param param 搜索参数 | ||||||
|  |      * @return PageResult<SparePartListVo> | ||||||
|  |      */ | ||||||
|  |     @Override | ||||||
|  |     public PageResult<SparePartListVo> list(PageParam pageParam, SparePartParam param) { | ||||||
|  |         Integer page  = pageParam.getPageNo(); | ||||||
|  |         Integer limit = pageParam.getPageSize(); | ||||||
|  | 
 | ||||||
|  |         Assert.notNull(param.getClientId(),"客户id不可为空"); | ||||||
|  |         SparePartDto sparePartDto = new SparePartDto(); | ||||||
|  |         BeanUtils.copyProperties(param,sparePartDto); | ||||||
|  | 
 | ||||||
|  |         Client client = clientMapper.findClientById(param.getClientId()); | ||||||
|  |         Map<Long,String> warehouseMap = new HashMap<>(); | ||||||
|  | 
 | ||||||
|  |         List<SparePartListVo> sparePartList = new ArrayList<>(); | ||||||
|  |         IPage<SparePartDto> iPage = sparePartMapper.pageList(new Page<>(page, limit),sparePartDto); | ||||||
|  |         for (SparePartDto item : iPage.getRecords()) { | ||||||
|  |             SparePartListVo sparePartListVo = new SparePartListVo(); | ||||||
|  |             BeanUtils.copyProperties(item, sparePartListVo); | ||||||
|  | 
 | ||||||
|  |             //设置订单实际价格
 | ||||||
|  |             BigDecimal practicalPrice = item.getUnitPrice().multiply(client.getPurchaseDivisor()); | ||||||
|  |             sparePartListVo.setUnitPrice(practicalPrice); | ||||||
|  | 
 | ||||||
|  |             if(warehouseMap.get(item.getWarehouseId()) == null){ | ||||||
|  |                 Warehouse warehouse = warehouseMapper.findWarehouseById(item.getWarehouseId()); | ||||||
|  |                 sparePartListVo.setWarehouseName(warehouse.getWarehouseName()); | ||||||
|  |                 warehouseMap.put(warehouse.getId(),warehouse.getWarehouseName()); | ||||||
|  |             }else{ | ||||||
|  |                 sparePartListVo.setWarehouseName(warehouseMap.get(item.getWarehouseId())); | ||||||
|  |             } | ||||||
|  |             sparePartList.add(sparePartListVo); | ||||||
|  |         } | ||||||
|  | 
 | ||||||
|  |         return PageResult.iPageHandle(iPage.getTotal(), iPage.getCurrent(), iPage.getSize(), sparePartList); | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 备件信息详情 | ||||||
|  |      * | ||||||
|  |      * @author hcy | ||||||
|  |      * @param id 主键参数 | ||||||
|  |      * @return SparePart | ||||||
|  |      */ | ||||||
|  |     @Override | ||||||
|  |     public SparePartDetailVo detail(Integer id) { | ||||||
|  |         SparePart model = sparePartMapper.selectOne( | ||||||
|  |                 new QueryWrapper<SparePart>() | ||||||
|  |                     .eq("id", id) | ||||||
|  |                     .eq("is_delete", 0) | ||||||
|  |                     .last("limit 1")); | ||||||
|  |         Assert.notNull(model, "数据不存在"); | ||||||
|  | 
 | ||||||
|  |         SparePartDetailVo vo = new SparePartDetailVo(); | ||||||
|  |         BeanUtils.copyProperties(model, vo); | ||||||
|  |         //获取仓库名
 | ||||||
|  |         Warehouse warehouse = warehouseMapper.selectOne( | ||||||
|  |                 new QueryWrapper<Warehouse>() | ||||||
|  |                         .eq("id", model.getWarehouseId()) | ||||||
|  |                         .eq("is_delete", 0) | ||||||
|  |                         .last("limit 1")); | ||||||
|  |         vo.setWarehouseName(warehouse.getWarehouseName()); | ||||||
|  |         return vo; | ||||||
|  |     } | ||||||
|  | } | ||||||
|  | @ -0,0 +1,262 @@ | ||||||
|  | package com.hcy.front.service.warehouse.impl; | ||||||
|  | 
 | ||||||
|  | import com.alibaba.fastjson.JSONArray; | ||||||
|  | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | ||||||
|  | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | ||||||
|  | import com.hcy.common.constant.GlobalConstant; | ||||||
|  | import com.hcy.common.entity.sparePart.SparePart; | ||||||
|  | import com.hcy.common.entity.warehouse.Warehouse; | ||||||
|  | import com.hcy.common.mapper.sparePart.SparePartMapper; | ||||||
|  | import com.hcy.common.mapper.warehouse.WarehouseMapper; | ||||||
|  | import com.hcy.common.utils.ArrayUtil; | ||||||
|  | import com.hcy.common.utils.TimeUtil; | ||||||
|  | import com.hcy.front.service.warehouse.IWarehouseService; | ||||||
|  | import com.hcy.front.validate.warehouse.WarehouseParam; | ||||||
|  | import com.hcy.front.vo.warehouse.SparePartDetailVo; | ||||||
|  | import com.hcy.front.vo.warehouse.WarehouseDetailVo; | ||||||
|  | import com.hcy.front.vo.warehouse.WarehouseVo; | ||||||
|  | import org.springframework.beans.BeanUtils; | ||||||
|  | import org.springframework.stereotype.Service; | ||||||
|  | import org.springframework.util.Assert; | ||||||
|  | 
 | ||||||
|  | import javax.annotation.Resource; | ||||||
|  | import java.util.LinkedList; | ||||||
|  | import java.util.List; | ||||||
|  | import java.util.Map; | ||||||
|  | 
 | ||||||
|  | /** | ||||||
|  |  * 仓库管理实现类 | ||||||
|  |  */ | ||||||
|  | @Service | ||||||
|  | public class WarehouseServiceImpl implements IWarehouseService { | ||||||
|  |          | ||||||
|  |     @Resource | ||||||
|  |     WarehouseMapper warehouseMapper; | ||||||
|  | 
 | ||||||
|  |     @Resource | ||||||
|  |     SparePartMapper sparePartMapper; | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 仓库管理列表 | ||||||
|  |      * | ||||||
|  |      * @author hcy | ||||||
|  |      * @param params 搜索参数 | ||||||
|  |      * @return JSONArray | ||||||
|  |      */ | ||||||
|  |     @Override | ||||||
|  |     public JSONArray list(Map<String, String> params) { | ||||||
|  | 
 | ||||||
|  |         QueryWrapper<Warehouse> queryWrapper = new QueryWrapper<>(); | ||||||
|  |         queryWrapper.eq("is_delete", 0); | ||||||
|  |         queryWrapper.orderByDesc("id"); | ||||||
|  | 
 | ||||||
|  |         warehouseMapper.setSearch(queryWrapper, params, new String[]{ | ||||||
|  |             "=:parentId@parent_id:long", | ||||||
|  |             "like:warehouseName@warehouse_name:str", | ||||||
|  |             "like:warehouseCoding@warehouse_coding:str", | ||||||
|  |             "=:warehouseAddress@warehouse_address:str", | ||||||
|  |         }); | ||||||
|  | 
 | ||||||
|  |         List<Warehouse> array = warehouseMapper.selectList(queryWrapper); | ||||||
|  | 
 | ||||||
|  |         List<WarehouseDetailVo> lists = new LinkedList<>(); | ||||||
|  |         for (Warehouse warehouse : array) { | ||||||
|  |             WarehouseDetailVo vo = new WarehouseDetailVo(); | ||||||
|  |             BeanUtils.copyProperties(warehouse, vo); | ||||||
|  | 
 | ||||||
|  |             vo.setCreateTime(TimeUtil.timestampToDate(warehouse.getCreateTime())); | ||||||
|  |             vo.setUpdateTime(TimeUtil.timestampToDate(warehouse.getUpdateTime())); | ||||||
|  |             lists.add(vo); | ||||||
|  |         } | ||||||
|  | 
 | ||||||
|  |         JSONArray jsonArray = JSONArray.parseArray(JSONArray.toJSONString(lists)); | ||||||
|  |         return ArrayUtil.listToTree(jsonArray, "id", "pid", "children"); | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 仓库管理详情 | ||||||
|  |      * | ||||||
|  |      * @author hcy | ||||||
|  |      * @param id 主键参数 | ||||||
|  |      * @return Warehouse | ||||||
|  |      */ | ||||||
|  |     @Override | ||||||
|  |     public WarehouseDetailVo detail(Integer id) { | ||||||
|  |         Warehouse model = warehouseMapper.selectOne( | ||||||
|  |                 new QueryWrapper<Warehouse>() | ||||||
|  |                     .eq("id", id) | ||||||
|  |                     .eq("is_delete", 0) | ||||||
|  |                     .last("limit 1")); | ||||||
|  | 
 | ||||||
|  |         Assert.notNull(model, "数据不存在"); | ||||||
|  | 
 | ||||||
|  |         WarehouseDetailVo vo = new WarehouseDetailVo(); | ||||||
|  |         BeanUtils.copyProperties(model, vo); | ||||||
|  |         return vo; | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 仓库管理新增 | ||||||
|  |      * | ||||||
|  |      * @author hcy | ||||||
|  |      * @param warehouseParam 参数 | ||||||
|  |      */ | ||||||
|  |     @Override | ||||||
|  |     public void add(WarehouseParam warehouseParam) { | ||||||
|  |         Warehouse model = new Warehouse(); | ||||||
|  |         model.setPid(warehouseParam.getPid()); | ||||||
|  |         model.setWarehouseName(warehouseParam.getWarehouseName()); | ||||||
|  |         model.setWarehouseCoding(warehouseParam.getWarehouseCoding()); | ||||||
|  |         model.setWarehouseAddress(warehouseParam.getWarehouseAddress()); | ||||||
|  |         model.setCreateTime(System.currentTimeMillis() / 1000); | ||||||
|  |         warehouseMapper.insert(model); | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 仓库管理编辑 | ||||||
|  |      * | ||||||
|  |      * @author hcy | ||||||
|  |      * @param warehouseParam 参数 | ||||||
|  |      */ | ||||||
|  |     @Override | ||||||
|  |     public void edit(WarehouseParam warehouseParam) { | ||||||
|  |         Warehouse model = warehouseMapper.selectOne( | ||||||
|  |                 new QueryWrapper<Warehouse>() | ||||||
|  |                     .eq("id",  warehouseParam.getId()) | ||||||
|  |                     .eq("is_delete", 0) | ||||||
|  |                     .last("limit 1")); | ||||||
|  | 
 | ||||||
|  |         Assert.notNull(model, "数据不存在!"); | ||||||
|  | 
 | ||||||
|  |         model.setId(warehouseParam.getId()); | ||||||
|  |         model.setPid(warehouseParam.getPid()); | ||||||
|  |         model.setWarehouseName(warehouseParam.getWarehouseName()); | ||||||
|  |         model.setWarehouseCoding(warehouseParam.getWarehouseCoding()); | ||||||
|  |         model.setWarehouseAddress(warehouseParam.getWarehouseAddress()); | ||||||
|  |         model.setUpdateTime(System.currentTimeMillis() / 1000); | ||||||
|  |         warehouseMapper.updateById(model); | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 仓库管理删除 | ||||||
|  |      * | ||||||
|  |      * @author hcy | ||||||
|  |      * @param ids 主键ID | ||||||
|  |      */ | ||||||
|  |     @Override | ||||||
|  |     public void del(Long[] ids) { | ||||||
|  |         List<Warehouse> modelList = warehouseMapper.selectList( | ||||||
|  |                 new QueryWrapper<Warehouse>() | ||||||
|  |                         .in("id", ids)); | ||||||
|  |         for (Long id : ids) { | ||||||
|  |             //仓库存在配件且配件数量不为0时,不允许删除
 | ||||||
|  |             SparePart sparePart = sparePartMapper.selectOne( | ||||||
|  |                     new QueryWrapper<SparePart>() | ||||||
|  |                             .eq("warehouse_id", id) | ||||||
|  |                             .eq("is_delete", 0) | ||||||
|  |                             .last("limit 1")); | ||||||
|  |             if(sparePart != null && sparePart.getQuantity() != 0){ | ||||||
|  | 
 | ||||||
|  |             }else{ | ||||||
|  |                 Warehouse pModel = warehouseMapper.selectOne( | ||||||
|  |                         new QueryWrapper<Warehouse>() | ||||||
|  |                                 .select("id,pid,warehouse_name") | ||||||
|  |                                 .eq("pid", id) | ||||||
|  |                                 .eq("is_delete", 0) | ||||||
|  |                                 .last("limit 1")); | ||||||
|  |                 Assert.isNull(pModel, "请先删除子级仓库"); | ||||||
|  |             } | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  |         } | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  |         // GlobalConstant.NOT_DELETE 调用未删除常量
 | ||||||
|  |         // GlobalConstant.DELETE 删除标识
 | ||||||
|  | 
 | ||||||
|  |         for (Warehouse warehouse : modelList) { | ||||||
|  |             warehouse.setIsDelete(GlobalConstant.DELETE); | ||||||
|  |             warehouse.setDeleteTime(System.currentTimeMillis() / 1000); | ||||||
|  |             warehouseMapper.updateById(warehouse);// 进行伪删除 根据id把is_delete修改成1
 | ||||||
|  |         } | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 获取子节点仓库信息 | ||||||
|  |      * @param pid 父id | ||||||
|  |      * @return warehousesVo | ||||||
|  |      */ | ||||||
|  |     private List<WarehouseVo> getChildrenWarehouseVo(Long pid){ | ||||||
|  |         LambdaQueryWrapper<Warehouse> lambdaQueryWrapper = new LambdaQueryWrapper<Warehouse>() | ||||||
|  |                 .eq(Warehouse::getPid, pid) | ||||||
|  |                 .eq(Warehouse::getIsDelete,"0"); | ||||||
|  |         List<Warehouse> warehouses = warehouseMapper.selectList(lambdaQueryWrapper); | ||||||
|  |         //将实体类数据转到vo
 | ||||||
|  |         List<WarehouseVo> list = new LinkedList<>(); | ||||||
|  |         for(Warehouse item : warehouses) { | ||||||
|  |             WarehouseVo vo = new WarehouseVo(); | ||||||
|  |             BeanUtils.copyProperties(item, vo); | ||||||
|  |             list.add(vo); | ||||||
|  |         } | ||||||
|  |         //
 | ||||||
|  |         for (WarehouseVo item : list) { | ||||||
|  |             item.setWarehouseVoList(getChildrenWarehouseVo(item.getId())); | ||||||
|  | 
 | ||||||
|  |             //获取栏目的内容信息
 | ||||||
|  |             LambdaQueryWrapper<SparePart> sparePartLqw = new LambdaQueryWrapper<>(); | ||||||
|  |             sparePartLqw.eq(SparePart::getWarehouseId, item.getId()); | ||||||
|  |             //sparePartLqw.orderByDesc(AbContent::getReleaseDate);
 | ||||||
|  | 
 | ||||||
|  |             List<SparePart> sparePartVos = sparePartMapper.selectList(sparePartLqw); | ||||||
|  |             //将实体类数据转到vo
 | ||||||
|  |             List<SparePartDetailVo> sparePartList = new LinkedList<>(); | ||||||
|  |             for(SparePart sparePartItem : sparePartVos) { | ||||||
|  |                 SparePartDetailVo vo = new SparePartDetailVo(); | ||||||
|  |                 BeanUtils.copyProperties(sparePartItem, vo); | ||||||
|  |                 sparePartList.add(vo); | ||||||
|  |             } | ||||||
|  | 
 | ||||||
|  |             if(sparePartVos != null){ | ||||||
|  |                 item.setSparePartVos(sparePartList); | ||||||
|  |             } | ||||||
|  |         } | ||||||
|  |         return list; | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 传入仓库id时,查询仓库下的所有子仓库及子仓库的备件信息 | ||||||
|  |      * | ||||||
|  |      * @param warehouseVo | ||||||
|  |      * @return | ||||||
|  |      */ | ||||||
|  |     public WarehouseVo selectWarehouseData(WarehouseVo warehouseVo) { | ||||||
|  |         Warehouse warehouse = warehouseMapper.selectById(warehouseVo.getId()); | ||||||
|  | 
 | ||||||
|  |         WarehouseVo abWarehouseVo = new WarehouseVo(); | ||||||
|  |         BeanUtils.copyProperties(warehouse, abWarehouseVo); | ||||||
|  | 
 | ||||||
|  |         //查询子仓库信息
 | ||||||
|  |         abWarehouseVo.setWarehouseVoList(getChildrenWarehouseVo(abWarehouseVo.getId())); | ||||||
|  |         //获取仓库的备件信息
 | ||||||
|  |         LambdaQueryWrapper<SparePart> sparePartLqw = new LambdaQueryWrapper<>(); | ||||||
|  |         sparePartLqw.eq(SparePart::getWarehouseId, warehouseVo.getId()); | ||||||
|  |         //sparePartLqw.orderByDesc(SparePart::getReleaseDate);
 | ||||||
|  |         List<SparePart> abSparePartVos = sparePartMapper.selectList(sparePartLqw); | ||||||
|  | 
 | ||||||
|  |         //将实体类数据转到vo
 | ||||||
|  |         List<SparePartDetailVo> sparePartList = new LinkedList<>(); | ||||||
|  |         for(SparePart sparePartItem : abSparePartVos) { | ||||||
|  |             SparePartDetailVo vo = new SparePartDetailVo(); | ||||||
|  |             BeanUtils.copyProperties(sparePartItem, vo); | ||||||
|  |             sparePartList.add(vo); | ||||||
|  |         } | ||||||
|  | 
 | ||||||
|  |         if(abSparePartVos != null){ | ||||||
|  |             abWarehouseVo.setSparePartVos(sparePartList); | ||||||
|  |         } | ||||||
|  | 
 | ||||||
|  |         return abWarehouseVo; | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  | } | ||||||
|  | @ -1,5 +1,6 @@ | ||||||
| package com.hcy.front.validate.order; | package com.hcy.front.validate.order; | ||||||
| 
 | 
 | ||||||
|  | import com.hcy.front.validate.warehouse.SparePartParam; | ||||||
| import lombok.Data; | import lombok.Data; | ||||||
| import lombok.EqualsAndHashCode; | import lombok.EqualsAndHashCode; | ||||||
| import lombok.experimental.Accessors; | import lombok.experimental.Accessors; | ||||||
|  | @ -10,6 +11,7 @@ import javax.validation.constraints.NotNull; | ||||||
| import java.io.Serializable; | import java.io.Serializable; | ||||||
| import java.math.BigDecimal; | import java.math.BigDecimal; | ||||||
| import java.util.Date; | import java.util.Date; | ||||||
|  | import java.util.List; | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
|  * 检修订单参数 |  * 检修订单参数 | ||||||
|  | @ -33,7 +35,7 @@ public class MaintenanceOrderParam implements Serializable { | ||||||
|     @DecimalMin(value = "0", message = "orderSource参数值不能少于0", groups = {create.class}) |     @DecimalMin(value = "0", message = "orderSource参数值不能少于0", groups = {create.class}) | ||||||
|     private Integer orderSource; |     private Integer orderSource; | ||||||
| 
 | 
 | ||||||
|     private String orderStatus; |     private Integer orderStatus; | ||||||
| 
 | 
 | ||||||
|     @NotNull(message = "clientId参数缺失", groups = {create.class}) |     @NotNull(message = "clientId参数缺失", groups = {create.class}) | ||||||
|     @DecimalMin(value = "0", message = "clientId参数值不能少于0", groups = {create.class}) |     @DecimalMin(value = "0", message = "clientId参数值不能少于0", groups = {create.class}) | ||||||
|  | @ -104,8 +106,11 @@ public class MaintenanceOrderParam implements Serializable { | ||||||
|     private String creatorName; // 创建人姓名
 |     private String creatorName; // 创建人姓名
 | ||||||
|     private String receiverName; // 接单人姓名
 |     private String receiverName; // 接单人姓名
 | ||||||
| 
 | 
 | ||||||
| 
 |  | ||||||
|     private double longitude; // 经度
 |     private double longitude; // 经度
 | ||||||
|     private double latitude; // 纬度
 |     private double latitude; // 纬度
 | ||||||
|     private Integer queryType; // 查询类型 0-离我最近 1-时间优先
 |     private Integer queryType; // 查询类型 0-离我最近 1-时间优先
 | ||||||
|  |     private String likeWork; //关键字
 | ||||||
|  | 
 | ||||||
|  |     //服务报价列表
 | ||||||
|  |     private List<SparePartParam> sparePartParams; | ||||||
| } | } | ||||||
|  |  | ||||||
|  | @ -0,0 +1,62 @@ | ||||||
|  | package com.hcy.front.validate.order; | ||||||
|  | 
 | ||||||
|  | import lombok.EqualsAndHashCode; | ||||||
|  | import lombok.experimental.Accessors; | ||||||
|  | import org.hibernate.validator.constraints.Length; | ||||||
|  | 
 | ||||||
|  | import lombok.Data; | ||||||
|  | import javax.validation.constraints.*; | ||||||
|  | import java.io.Serializable; | ||||||
|  | import java.math.BigDecimal; | ||||||
|  | 
 | ||||||
|  | /** | ||||||
|  |  * 订单配件参数 | ||||||
|  |  */ | ||||||
|  | @Data | ||||||
|  | @EqualsAndHashCode(callSuper = false) | ||||||
|  | @Accessors(chain = true) | ||||||
|  | public class OrderSparePartParam implements Serializable { | ||||||
|  | 
 | ||||||
|  |     private static final long serialVersionUID = 1L; | ||||||
|  | 
 | ||||||
|  |     public interface create{} | ||||||
|  |     public interface update{} | ||||||
|  |     public interface delete{} | ||||||
|  | 
 | ||||||
|  |     private Long id; | ||||||
|  | 
 | ||||||
|  |     @NotNull(message = "sparePartsId参数缺失", groups = {create.class, update.class}) | ||||||
|  |     @DecimalMin(value = "0", message = "sparePartsId参数值不能少于0", groups = {create.class, update.class}) | ||||||
|  |     private Long sparePartsId; | ||||||
|  | 
 | ||||||
|  |     @NotNull(message = "sparePartsCode参数缺失", groups = {create.class, update.class}) | ||||||
|  |     @Length(max = 100, message = "sparePartsCode参数不能超出100个字符", groups = {create.class, update.class}) | ||||||
|  |     private String sparePartsCode; | ||||||
|  | 
 | ||||||
|  |     @NotNull(message = "sparePartsName参数缺失", groups = {create.class, update.class}) | ||||||
|  |     @Length(max = 50, message = "sparePartsName参数不能超出50个字符", groups = {create.class, update.class}) | ||||||
|  |     private String sparePartsName; | ||||||
|  | 
 | ||||||
|  |     @NotNull(message = "warehouseName参数缺失", groups = {create.class, update.class}) | ||||||
|  |     @Length(max = 100, message = "warehouseName参数不能超出100个字符", groups = {create.class, update.class}) | ||||||
|  |     private String warehouseName; | ||||||
|  | 
 | ||||||
|  |     @NotNull(message = "specificationsModel参数缺失", groups = {create.class, update.class}) | ||||||
|  |     @Length(max = 50, message = "specificationsModel参数不能超出50个字符", groups = {create.class, update.class}) | ||||||
|  |     private String specificationsModel; | ||||||
|  | 
 | ||||||
|  |     @NotNull(message = "unit参数缺失", groups = {create.class, update.class}) | ||||||
|  |     @Length(max = 20, message = "unit参数不能超出20个字符", groups = {create.class, update.class}) | ||||||
|  |     private String unit; | ||||||
|  | 
 | ||||||
|  |     @NotNull(message = "price参数缺失", groups = {create.class, update.class}) | ||||||
|  |     private BigDecimal price; | ||||||
|  | 
 | ||||||
|  |     @NotNull(message = "quantity参数缺失", groups = {create.class, update.class}) | ||||||
|  |     @DecimalMin(value = "0", message = "quantity参数值不能少于0", groups = {create.class, update.class}) | ||||||
|  |     private Long quantity; | ||||||
|  | 
 | ||||||
|  |     @NotNull(message = "totalPrice参数缺失", groups = {create.class, update.class}) | ||||||
|  |     private BigDecimal totalPrice; | ||||||
|  | 
 | ||||||
|  | } | ||||||
|  | @ -0,0 +1,60 @@ | ||||||
|  | package com.hcy.front.validate.warehouse; | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | import com.hcy.common.entity.client.Client; | ||||||
|  | import lombok.Data; | ||||||
|  | import lombok.EqualsAndHashCode; | ||||||
|  | import lombok.experimental.Accessors; | ||||||
|  | import org.hibernate.validator.constraints.Length; | ||||||
|  | 
 | ||||||
|  | import javax.validation.constraints.DecimalMin; | ||||||
|  | import javax.validation.constraints.NotNull; | ||||||
|  | import java.io.Serializable; | ||||||
|  | import java.math.BigDecimal; | ||||||
|  | import java.util.List; | ||||||
|  | 
 | ||||||
|  | /** | ||||||
|  |  * 备件信息参数 | ||||||
|  |  */ | ||||||
|  | @Data | ||||||
|  | @EqualsAndHashCode(callSuper = false) | ||||||
|  | @Accessors(chain = true) | ||||||
|  | public class SparePartParam implements Serializable { | ||||||
|  | 
 | ||||||
|  |     private static final long serialVersionUID = 1L; | ||||||
|  | 
 | ||||||
|  |     public interface create{} | ||||||
|  |     public interface update{} | ||||||
|  |     public interface delete{} | ||||||
|  | 
 | ||||||
|  |     private Long id; | ||||||
|  | 
 | ||||||
|  |     @NotNull(message = "sparePartsCode参数缺失", groups = {create.class, update.class}) | ||||||
|  |     @Length(max = 255, message = "sparePartsCode参数不能超出255个字符", groups = {create.class, update.class}) | ||||||
|  |     private String sparePartsCode; | ||||||
|  | 
 | ||||||
|  |     @NotNull(message = "sparePartsName参数缺失", groups = {create.class, update.class}) | ||||||
|  |     @Length(max = 255, message = "sparePartsName参数不能超出255个字符", groups = {create.class, update.class}) | ||||||
|  |     private String sparePartsName; | ||||||
|  | 
 | ||||||
|  |     @NotNull(message = "warehouseId参数缺失", groups = {create.class, update.class}) | ||||||
|  |     @DecimalMin(value = "0", message = "warehouseId参数值不能少于0", groups = {create.class, update.class}) | ||||||
|  |     private Long warehouseId; | ||||||
|  | 
 | ||||||
|  |     @NotNull(message = "specificationsModel参数缺失", groups = {create.class, update.class}) | ||||||
|  |     @Length(max = 255, message = "specificationsModel参数不能超出255个字符", groups = {create.class, update.class}) | ||||||
|  |     private String specificationsModel; | ||||||
|  | 
 | ||||||
|  |     @NotNull(message = "unit参数缺失", groups = {create.class, update.class}) | ||||||
|  |     @Length(max = 11, message = "unit参数不能超出11个字符", groups = {create.class, update.class}) | ||||||
|  |     private String unit; | ||||||
|  | 
 | ||||||
|  |     private Integer quantity; | ||||||
|  | 
 | ||||||
|  |     private BigDecimal unitPrice; | ||||||
|  | 
 | ||||||
|  |     private List<Integer> ids; //批量删除
 | ||||||
|  | 
 | ||||||
|  |     private String keywords; //关键字
 | ||||||
|  |     private Long clientId; //客户id
 | ||||||
|  | } | ||||||
|  | @ -0,0 +1,43 @@ | ||||||
|  | package com.hcy.front.validate.warehouse; | ||||||
|  | 
 | ||||||
|  | import lombok.Data; | ||||||
|  | import lombok.EqualsAndHashCode; | ||||||
|  | import lombok.experimental.Accessors; | ||||||
|  | import org.hibernate.validator.constraints.Length; | ||||||
|  | 
 | ||||||
|  | import javax.validation.constraints.NotNull; | ||||||
|  | import java.io.Serializable; | ||||||
|  | 
 | ||||||
|  | /** | ||||||
|  |  * 仓库管理参数 | ||||||
|  |  */ | ||||||
|  | @Data | ||||||
|  | @EqualsAndHashCode(callSuper = false) | ||||||
|  | @Accessors(chain = true) | ||||||
|  | public class WarehouseParam implements Serializable { | ||||||
|  | 
 | ||||||
|  |     private static final long serialVersionUID = 1L; | ||||||
|  | 
 | ||||||
|  |     public interface create{} | ||||||
|  |     public interface update{} | ||||||
|  |     public interface delete{} | ||||||
|  | 
 | ||||||
|  |     @NotNull(message = "id参数缺失", groups = {update.class, delete.class}) | ||||||
|  |     private Long id; | ||||||
|  | 
 | ||||||
|  |     private Long pid; | ||||||
|  | 
 | ||||||
|  |     @NotNull(message = "warehouseName参数缺失", groups = {create.class, update.class}) | ||||||
|  |     @Length(max = 255, message = "warehouseName参数不能超出255个字符", groups = {create.class, update.class}) | ||||||
|  |     private String warehouseName; | ||||||
|  | 
 | ||||||
|  |     @NotNull(message = "warehouseCoding参数缺失", groups = {create.class, update.class}) | ||||||
|  |     @Length(max = 255, message = "warehouseCoding参数不能超出255个字符", groups = {create.class, update.class}) | ||||||
|  |     private String warehouseCoding; | ||||||
|  | 
 | ||||||
|  |     @NotNull(message = "warehouseAddress参数缺失", groups = {create.class, update.class}) | ||||||
|  |     @Length(max = 255, message = "warehouseAddress参数不能超出255个字符", groups = {create.class, update.class}) | ||||||
|  |     private String warehouseAddress; | ||||||
|  | 
 | ||||||
|  |     private Long[] ids; | ||||||
|  | } | ||||||
|  | @ -17,8 +17,8 @@ public class MaintenanceOrderDetailVo implements Serializable { | ||||||
| 
 | 
 | ||||||
|     private Long id; // id
 |     private Long id; // id
 | ||||||
|     private String orderNo; // 订单编号
 |     private String orderNo; // 订单编号
 | ||||||
|     private Long orderSource; // 订单来源 0-客户上报;1-系统创建;2-维修员创建;3-检修员创建;4-客服创建;5-维修主管创建
 |     private Integer orderSource; // 订单来源 0-客户上报;1-系统创建;2-维修员创建;3-检修员创建;4-客服创建;5-维修主管创建
 | ||||||
|     private Long orderStatus; // 订单状态 0-待抢单;1-待接单;2-接单超时;3-检测中;4-待客户确认;5-维修中;6-已完成;7-已退单;8-已关闭
 |     private Integer orderStatus; // 订单状态 0-待抢单;1-待接单;2-接单超时;3-检测中;4-待客户确认;5-维修中;6-已完成;7-已退单;8-已关闭
 | ||||||
|     private Long clientId; // 客户id
 |     private Long clientId; // 客户id
 | ||||||
|     private Long equipmentId; // 设备id
 |     private Long equipmentId; // 设备id
 | ||||||
|     private Long faultId; // 故障id
 |     private Long faultId; // 故障id
 | ||||||
|  | @ -43,6 +43,7 @@ public class MaintenanceOrderDetailVo implements Serializable { | ||||||
|     private Long familiarFaultId; // 常见维修结论id
 |     private Long familiarFaultId; // 常见维修结论id
 | ||||||
|     private String familiarFaultDescription; // 常见维修结论描述
 |     private String familiarFaultDescription; // 常见维修结论描述
 | ||||||
|     private Integer repairWorkOrderFlow; //工单去向 0=工单池 1=检修员
 |     private Integer repairWorkOrderFlow; //工单去向 0=工单池 1=检修员
 | ||||||
|  |     private Date createTime; // 创建时间
 | ||||||
| 
 | 
 | ||||||
|     private String clientName; // 客户姓名
 |     private String clientName; // 客户姓名
 | ||||||
|     private Equipment equipment; //设备信息
 |     private Equipment equipment; //设备信息
 | ||||||
|  |  | ||||||
|  | @ -44,7 +44,8 @@ public class MaintenanceOrderListVo implements Serializable { | ||||||
|     private Date createTime; // 创建时间
 |     private Date createTime; // 创建时间
 | ||||||
|     private Date updateTime; // 更新时间
 |     private Date updateTime; // 更新时间
 | ||||||
|     private Integer repairWorkOrderFlow; //工单去向 0=工单池 1=检修员
 |     private Integer repairWorkOrderFlow; //工单去向 0=工单池 1=检修员
 | ||||||
|     private String distance; //距离
 |     private Double distance; //距离
 | ||||||
|  |     private String practicalDistance; //实际距离
 | ||||||
| 
 | 
 | ||||||
|     private String faultName; //故障名称
 |     private String faultName; //故障名称
 | ||||||
|     private String equipmentNo; //设备编号
 |     private String equipmentNo; //设备编号
 | ||||||
|  |  | ||||||
|  | @ -0,0 +1,27 @@ | ||||||
|  | package com.hcy.front.vo.order; | ||||||
|  | 
 | ||||||
|  | import lombok.Data; | ||||||
|  | 
 | ||||||
|  | import java.io.Serializable; | ||||||
|  | import java.math.BigDecimal; | ||||||
|  | 
 | ||||||
|  | /** | ||||||
|  |  * OrderSparePartVo | ||||||
|  |  */ | ||||||
|  | @Data | ||||||
|  | public class OrderSparePartDetailVo implements Serializable { | ||||||
|  | 
 | ||||||
|  |     private static final long serialVersionUID = 1L; | ||||||
|  | 
 | ||||||
|  |     private Long id; // id
 | ||||||
|  |     private Long sparePartsId; // 备件id
 | ||||||
|  |     private String sparePartsCode; // 备件编码
 | ||||||
|  |     private String sparePartsName; // 备件名称
 | ||||||
|  |     private String warehouseName; // 所属仓库名称
 | ||||||
|  |     private String specificationsModel; // 规格型号
 | ||||||
|  |     private String unit; // 单位
 | ||||||
|  |     private BigDecimal price; // 价格
 | ||||||
|  |     private Long quantity; // 数量
 | ||||||
|  |     private BigDecimal totalPrice; // 总价
 | ||||||
|  | 
 | ||||||
|  | } | ||||||
|  | @ -0,0 +1,27 @@ | ||||||
|  | package com.hcy.front.vo.order; | ||||||
|  | 
 | ||||||
|  | import lombok.Data; | ||||||
|  | 
 | ||||||
|  | import java.io.Serializable; | ||||||
|  | import java.math.BigDecimal; | ||||||
|  | 
 | ||||||
|  | /** | ||||||
|  |  * OrderSparePartVo | ||||||
|  |  */ | ||||||
|  | @Data | ||||||
|  | public class OrderSparePartListVo implements Serializable { | ||||||
|  | 
 | ||||||
|  |     private static final long serialVersionUID = 1L; | ||||||
|  | 
 | ||||||
|  |     private Long id; // id
 | ||||||
|  |     private Long sparePartsId; // 备件id
 | ||||||
|  |     private String sparePartsCode; // 备件编码
 | ||||||
|  |     private String sparePartsName; // 备件名称
 | ||||||
|  |     private String warehouseName; // 所属仓库名称
 | ||||||
|  |     private String specificationsModel; // 规格型号
 | ||||||
|  |     private String unit; // 单位
 | ||||||
|  |     private BigDecimal price; // 价格
 | ||||||
|  |     private Long quantity; // 数量
 | ||||||
|  |     private BigDecimal totalPrice; // 总价
 | ||||||
|  | 
 | ||||||
|  | } | ||||||
|  | @ -0,0 +1,26 @@ | ||||||
|  | package com.hcy.front.vo.warehouse; | ||||||
|  | 
 | ||||||
|  | import lombok.Data; | ||||||
|  | 
 | ||||||
|  | import java.io.Serializable; | ||||||
|  | import java.math.BigDecimal; | ||||||
|  | 
 | ||||||
|  | /** | ||||||
|  |  * SparePartVo | ||||||
|  |  */ | ||||||
|  | @Data | ||||||
|  | public class SparePartDetailVo implements Serializable { | ||||||
|  | 
 | ||||||
|  |     private static final long serialVersionUID = 1L; | ||||||
|  | 
 | ||||||
|  |     private Long id; // 主键id
 | ||||||
|  |     private String sparePartsCode; // 备件编码
 | ||||||
|  |     private String sparePartsName; // 备件名称
 | ||||||
|  |     private Long warehouseId; // 所属仓库
 | ||||||
|  |     private String specificationsModel; // 规格型号
 | ||||||
|  |     private String unit; // 单位
 | ||||||
|  |     private Integer quantity; // 库存数量
 | ||||||
|  |     private BigDecimal unitPrice; // 单价
 | ||||||
|  |     private String warehouseName; // 所属仓库名
 | ||||||
|  | 
 | ||||||
|  | } | ||||||
|  | @ -0,0 +1,30 @@ | ||||||
|  | package com.hcy.front.vo.warehouse; | ||||||
|  | 
 | ||||||
|  | import lombok.Data; | ||||||
|  | 
 | ||||||
|  | import java.io.Serializable; | ||||||
|  | import java.math.BigDecimal; | ||||||
|  | 
 | ||||||
|  | /** | ||||||
|  |  * SparePartVo | ||||||
|  |  */ | ||||||
|  | @Data | ||||||
|  | public class SparePartListVo implements Serializable { | ||||||
|  | 
 | ||||||
|  |     private static final long serialVersionUID = 1L; | ||||||
|  | 
 | ||||||
|  |     private Long id; // 主键id
 | ||||||
|  |     private String sparePartsCode; // 备件编码
 | ||||||
|  |     private String sparePartsName; // 备件名称
 | ||||||
|  |     private Long warehouseId; // 所属仓库
 | ||||||
|  |     private String specificationsModel; // 规格型号
 | ||||||
|  |     private String unit; // 单位
 | ||||||
|  |     private Integer quantity; // 库存数量
 | ||||||
|  |     private String createTime; // 创建时间
 | ||||||
|  |     private String updateTime; // 更新时间
 | ||||||
|  |     private BigDecimal unitPrice; // 单价
 | ||||||
|  | 
 | ||||||
|  |     // 备件模糊关键字
 | ||||||
|  |     private String likeWork; | ||||||
|  |     private String warehouseName; // 所属仓库名
 | ||||||
|  | } | ||||||
|  | @ -0,0 +1,23 @@ | ||||||
|  | package com.hcy.front.vo.warehouse; | ||||||
|  | 
 | ||||||
|  | import lombok.Data; | ||||||
|  | 
 | ||||||
|  | import java.io.Serializable; | ||||||
|  | 
 | ||||||
|  | /** | ||||||
|  |  * WarehouseVo | ||||||
|  |  */ | ||||||
|  | @Data | ||||||
|  | public class WarehouseDetailVo implements Serializable { | ||||||
|  | 
 | ||||||
|  |     private static final long serialVersionUID = 1L; | ||||||
|  | 
 | ||||||
|  |     private Long id; // 主键id
 | ||||||
|  |     private Long pid; // 上级仓库
 | ||||||
|  |     private String warehouseName; // 仓库名称(唯一)
 | ||||||
|  |     private String warehouseCoding; // 仓库编码
 | ||||||
|  |     private String warehouseAddress; // 仓库地址
 | ||||||
|  |     private String createTime; // 创建时间
 | ||||||
|  |     private String updateTime; // 更新时间
 | ||||||
|  | 
 | ||||||
|  | } | ||||||
|  | @ -0,0 +1,20 @@ | ||||||
|  | package com.hcy.front.vo.warehouse; | ||||||
|  | 
 | ||||||
|  | import lombok.Data; | ||||||
|  | 
 | ||||||
|  | import java.io.Serializable; | ||||||
|  | 
 | ||||||
|  | /** | ||||||
|  |  * WarehouseVo | ||||||
|  |  */ | ||||||
|  | @Data | ||||||
|  | public class WarehouseListVo implements Serializable { | ||||||
|  | 
 | ||||||
|  |     private static final long serialVersionUID = 1L; | ||||||
|  | 
 | ||||||
|  |     private Long id; // 主键id
 | ||||||
|  |     private Long pid; // 上级仓库
 | ||||||
|  |     private String warehouseName; // 仓库名称(唯一)
 | ||||||
|  |     private String warehouseCoding; // 仓库编码
 | ||||||
|  |     private String warehouseAddress; // 仓库地址
 | ||||||
|  | } | ||||||
|  | @ -0,0 +1,27 @@ | ||||||
|  | package com.hcy.front.vo.warehouse; | ||||||
|  | 
 | ||||||
|  | import lombok.Data; | ||||||
|  | 
 | ||||||
|  | import java.io.Serializable; | ||||||
|  | import java.util.List; | ||||||
|  | 
 | ||||||
|  | @Data | ||||||
|  | public class WarehouseVo implements Serializable { | ||||||
|  | 
 | ||||||
|  |     private Long id; // 主键id
 | ||||||
|  |     private Long pid; // 上级仓库
 | ||||||
|  |     private String warehouseName; // 仓库名称(唯一)
 | ||||||
|  |     private String warehouseCoding; // 仓库编码
 | ||||||
|  |     private String warehouseAddress; // 仓库地址
 | ||||||
|  |     private String createTime; // 创建时间
 | ||||||
|  |     private String updateTime; // 更新时间
 | ||||||
|  |     /** | ||||||
|  |      * 子栏目 | ||||||
|  |      */ | ||||||
|  |     private List<WarehouseVo> warehouseVoList; | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 所属内容信息 | ||||||
|  |      */ | ||||||
|  |     private List<SparePartDetailVo> sparePartVos; | ||||||
|  | } | ||||||
		Loading…
	
		Reference in New Issue