mirror of
http://192.168.1.205:9980/cf_devdept2/cf_imes_server.git
synced 2026-08-12 12:52:07 +08:00
管理详情分离组件
This commit is contained in:
+25
-4
@@ -16,6 +16,7 @@ import com.cf.imes.module.executor.controller.admin.order.vo.product.OrderRoomBo
|
||||
import com.cf.imes.module.executor.controller.admin.orderParts.vo.OrderPartsRespVO;
|
||||
import com.cf.imes.module.executor.dal.dataobject.order.OrderDO;
|
||||
import com.cf.imes.module.executor.dal.mysql.order.OrderMapper;
|
||||
import com.cf.imes.module.executor.enums.CategoryEnum;
|
||||
import com.cf.imes.module.executor.enums.OrderDeletedEnum;
|
||||
import com.cf.imes.module.executor.enums.OrderStatusEnum;
|
||||
import com.cf.imes.module.executor.service.order.OrderInputProcessor;
|
||||
@@ -45,9 +46,7 @@ import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.Valid;
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import java.io.File;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.ExecutionException;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
|
||||
@@ -479,10 +478,15 @@ public class OrderController {
|
||||
if (orderBodyPageRespVO.getDeleted() == null) {
|
||||
orderBodyPageRespVO.setDeleted(false);
|
||||
}
|
||||
Set<String> types = new HashSet<>();
|
||||
// 配件
|
||||
types.add(CategoryEnum.HARDWARE.getValue());
|
||||
types.add(CategoryEnum.EDGING.getValue());
|
||||
|
||||
return success(orderService.getPartsDetail(orderBodyPageRespVO.getOrderId(),
|
||||
orderBodyPageRespVO.getRoomIds(), orderBodyPageRespVO.getBodyIds(),
|
||||
orderBodyPageRespVO.getGroupIds(), orderBodyPageRespVO.getPartsName(),
|
||||
orderBodyPageRespVO.getPageNo(), orderBodyPageRespVO.getPageSize(), !orderBodyPageRespVO.getDeleted() ? 0 : 1));
|
||||
orderBodyPageRespVO.getPageNo(), orderBodyPageRespVO.getPageSize(), !orderBodyPageRespVO.getDeleted() ? 0 : 1, types));
|
||||
}
|
||||
|
||||
|
||||
@@ -499,6 +503,23 @@ public class OrderController {
|
||||
orderBodyPageRespVO.getPageNo(), orderBodyPageRespVO.getPageSize(), !orderBodyPageRespVO.getDeleted() ? 0 : 1));
|
||||
}
|
||||
|
||||
@PostMapping("/get-componentDetailsPage")
|
||||
@Operation(summary = "生产单详情-组件详细信息(分页)")
|
||||
@PreAuthorize("@ss.hasPermission('production:manager-list:detail')")
|
||||
public CommonResult<PageResult<OrderPartsRespVO>> componentDetails(@Valid @RequestBody OrderBodyPageRespVO orderBodyPageRespVO) {
|
||||
if (orderBodyPageRespVO.getDeleted() == null) {
|
||||
orderBodyPageRespVO.setDeleted(false);
|
||||
}
|
||||
Set<String> types = new HashSet<>();
|
||||
// 配件
|
||||
types.add(CategoryEnum.ASSEMBLY.getValue());
|
||||
|
||||
return success(orderService.getPartsDetail(orderBodyPageRespVO.getOrderId(),
|
||||
orderBodyPageRespVO.getRoomIds(), orderBodyPageRespVO.getBodyIds(),
|
||||
orderBodyPageRespVO.getGroupIds(), orderBodyPageRespVO.getPartsName(),
|
||||
orderBodyPageRespVO.getPageNo(), orderBodyPageRespVO.getPageSize(), !orderBodyPageRespVO.getDeleted() ? 0 : 1, types));
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete-body")
|
||||
@Operation(summary = "删除柜体")
|
||||
@PreAuthorize("@ss.hasPermission('production:manager-list:deleteCabinet')")
|
||||
|
||||
+3
-2
@@ -42,12 +42,13 @@ public interface OrderItemMapper extends BaseMapperX<OrderItemDO> {
|
||||
|
||||
IPage<OrderPartsRespVO> selectPartsDetailByOrderId(@Param("page") IPage page, @Param("orderId") Long orderId, @Param("roomId") Set<Long> roomId,
|
||||
@Param("bodyId") Set<Long> bodyId, @Param("groupId") Set<Long> groupId, @Param("name") String name,
|
||||
@Param("organId") Long organId, @Param("deleted") Integer deleted);
|
||||
@Param("organId") Long organId, @Param("deleted") Integer deleted, @Param("types") Set<String> types);
|
||||
|
||||
|
||||
List<OrderPlatesDetailRespVO> selectPartsByOrderId(@Param("orderId") Long orderId,
|
||||
@Param("organId") Long organId,
|
||||
@Param("deleted") Integer deleted);
|
||||
@Param("deleted") Integer deleted,
|
||||
@Param("types") Set<String> types);
|
||||
|
||||
|
||||
List<PlateRespVO> selectPlateList(@Param("reqVO") PlateDetailReqVO reqVO, @Param("organId") Long organId);
|
||||
|
||||
+1
-1
@@ -80,7 +80,7 @@ public interface OrderService {
|
||||
* @return List<OrderPartsRespVO>
|
||||
* 需要修改返回值
|
||||
*/
|
||||
PageResult<OrderPartsRespVO> getPartsDetail(Long orderId, Set<Long> roomId , Set<Long> bodyId, Set<Long> groupId, String name, Integer pageNo, Integer pageSize, Integer deleted);
|
||||
PageResult<OrderPartsRespVO> getPartsDetail(Long orderId, Set<Long> roomId , Set<Long> bodyId, Set<Long> groupId, String name, Integer pageNo, Integer pageSize, Integer deleted, Set<String> types);
|
||||
|
||||
/**
|
||||
* @param orderId: 生产单id
|
||||
|
||||
+13
-3
@@ -51,6 +51,7 @@ import com.cf.imes.module.executor.dal.mysql.plan.PlanMapper;
|
||||
import com.cf.imes.module.executor.dal.mysql.plate.PlateGoodMapper;
|
||||
import com.cf.imes.module.executor.dal.mysql.plate.PlateMapper;
|
||||
import com.cf.imes.module.executor.dal.mysql.rawgoods.RawGoodsMapper;
|
||||
import com.cf.imes.module.executor.enums.CategoryEnum;
|
||||
import com.cf.imes.module.executor.enums.OrderDeletedEnum;
|
||||
import com.cf.imes.module.executor.enums.OrderStatusEnum;
|
||||
import com.cf.imes.module.executor.service.customplateno.CustomPlateNoGenerateService;
|
||||
@@ -224,16 +225,25 @@ public class OrderServiceImpl implements OrderService {
|
||||
// 柜体信息
|
||||
List<OrderModuleRespVO> orderModuleRespVOList = orderBodyMapper.selectModuleByOrderId(orderId, getUserOrganId(), deleted);
|
||||
|
||||
Set<String> types = new HashSet<>();
|
||||
// 配件
|
||||
List<OrderPlatesDetailRespVO> orderItemDOS = orderItemMapper.selectPartsByOrderId(orderId, getUserOrganId(), deleted);
|
||||
types.add(CategoryEnum.HARDWARE.getValue());
|
||||
types.add(CategoryEnum.EDGING.getValue());
|
||||
List<OrderPlatesDetailRespVO> orderItemDOS = orderItemMapper.selectPartsByOrderId(orderId, getUserOrganId(), deleted, types);
|
||||
|
||||
// 板材
|
||||
List<OrderGoodsRespVO> orderGoodsRespVOS = orderItemMapper.selectGoodsByOrderId(orderId, getUserOrganId(), deleted);
|
||||
|
||||
// 组件
|
||||
types.clear();
|
||||
types.add(CategoryEnum.ASSEMBLY.getValue());
|
||||
List<OrderPlatesDetailRespVO> orderComponentRespVOS = orderItemMapper.selectPartsByOrderId(orderId, getUserOrganId(), deleted, types);
|
||||
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("module", orderModuleRespVOList);
|
||||
map.put("parts", orderItemDOS);
|
||||
map.put("goods", orderGoodsRespVOS);
|
||||
map.put("component", orderComponentRespVOS);
|
||||
return map;
|
||||
}
|
||||
|
||||
@@ -249,10 +259,10 @@ public class OrderServiceImpl implements OrderService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<OrderPartsRespVO> getPartsDetail(Long orderId, Set<Long> roomId, Set<Long> bodyId, Set<Long> groupId, String name, Integer pageNo, Integer pageSize, Integer deleted) {
|
||||
public PageResult<OrderPartsRespVO> getPartsDetail(Long orderId, Set<Long> roomId, Set<Long> bodyId, Set<Long> groupId, String name, Integer pageNo, Integer pageSize, Integer deleted, Set<String> types) {
|
||||
PageDTO<OrderRespVOCopy> page = new PageDTO<>(pageNo, pageSize);
|
||||
|
||||
IPage<OrderPartsRespVO> orderDetail = orderItemMapper.selectPartsDetailByOrderId(page, orderId, roomId, bodyId, groupId, name, getUserOrganId(), deleted);
|
||||
IPage<OrderPartsRespVO> orderDetail = orderItemMapper.selectPartsDetailByOrderId(page, orderId, roomId, bodyId, groupId, name, getUserOrganId(), deleted, types);
|
||||
|
||||
return new PageResult(orderDetail.getRecords(), orderDetail.getTotal());
|
||||
}
|
||||
|
||||
+12
-3
@@ -36,7 +36,7 @@
|
||||
</select>
|
||||
|
||||
<select id="selectPartsDetailByOrderId" resultType="com.cf.imes.module.executor.controller.admin.orderParts.vo.OrderPartsRespVO">
|
||||
SELECT i.order_id, p.id, p.model, p.spec, p.name, SUM(i.num) AS num, p.unit, p.brand, p.factory, p.remark,p.type,p.price,
|
||||
SELECT i.order_id, p.model, p.spec, p.name, SUM(i.num) AS num, p.unit, p.brand, p.factory, p.remark,p.type,p.price,
|
||||
p.is_composite,p.create_time, p.color, p.category, p.length, p.width, p.thickness, p.material, p.goods_id
|
||||
FROM order_item i
|
||||
RIGHT JOIN `order_parts` p ON i.organ_id = p.organ_id AND i.order_id = p.order_id AND i.parts_id = p.id
|
||||
@@ -60,12 +60,18 @@
|
||||
#{groupIdItem}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="types != null and types.size() > 0">
|
||||
AND p.category IN
|
||||
<foreach item="type" collection="types" open="(" separator="," close=")">
|
||||
#{type}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="name != null">
|
||||
AND p.name = #{name}
|
||||
</if>
|
||||
GROUP BY
|
||||
i.order_id,
|
||||
p.id,
|
||||
-- p.id,
|
||||
p.model,
|
||||
p.spec,
|
||||
p.name,
|
||||
@@ -92,7 +98,10 @@
|
||||
FROM `order_item` i
|
||||
RIGHT JOIN `order_parts` p ON i.organ_id = p.organ_id AND i.order_id = p.order_id AND i.parts_id = p.id
|
||||
RIGHT JOIN `order_body` ob ON i.organ_id = ob.organ_id AND i.order_id = ob.order_id AND i.body_id = ob.id
|
||||
WHERE i.organ_id = #{organId} AND i.order_id = #{orderId} AND ob.deleted = #{deleted}
|
||||
WHERE i.organ_id = #{organId} AND i.order_id = #{orderId} AND ob.deleted = #{deleted} AND p.category in
|
||||
<foreach item="type" collection="types" open="(" separator="," close=")">
|
||||
#{type}
|
||||
</foreach>
|
||||
GROUP BY
|
||||
i.order_id,
|
||||
i.room_id,
|
||||
|
||||
Reference in New Issue
Block a user