mirror of
http://192.168.1.205:9980/cf_devdept2/cf_imes_server.git
synced 2026-08-12 21:02:08 +08:00
分页打包接口参数修改,数据源字段key名称更改
This commit is contained in:
+2
-2
@@ -14,8 +14,8 @@ import lombok.ToString;
|
|||||||
public class PackPageReqVO extends PageParam {
|
public class PackPageReqVO extends PageParam {
|
||||||
|
|
||||||
|
|
||||||
@Schema(description = "生产状态(已完成,未完成)", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
|
@Schema(description = "打包状态(0:未打包,1:已打包)", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
|
||||||
private Boolean status;
|
private Integer status;
|
||||||
|
|
||||||
|
|
||||||
@Schema(description = "订单号")
|
@Schema(description = "订单号")
|
||||||
|
|||||||
+1
-1
@@ -42,7 +42,7 @@ public class PackRespVO {
|
|||||||
|
|
||||||
|
|
||||||
@Schema(description = "打包状态", requiredMode = Schema.RequiredMode.REQUIRED,example = "0")
|
@Schema(description = "打包状态", requiredMode = Schema.RequiredMode.REQUIRED,example = "0")
|
||||||
private Integer status;
|
private Integer packaged;
|
||||||
|
|
||||||
|
|
||||||
@Schema(description = "客户", requiredMode = Schema.RequiredMode.REQUIRED,example = "张三")
|
@Schema(description = "客户", requiredMode = Schema.RequiredMode.REQUIRED,example = "张三")
|
||||||
|
|||||||
+39
-23
@@ -107,12 +107,20 @@ public class PackServiceImpl implements PackService {
|
|||||||
PageDTO<PackRespVO> page = new PageDTO<>(pageReqVO.getPageNo(), pageReqVO.getPageSize());
|
PageDTO<PackRespVO> page = new PageDTO<>(pageReqVO.getPageNo(), pageReqVO.getPageSize());
|
||||||
|
|
||||||
// 根据生产状态查询生产单号
|
// 根据生产状态查询生产单号
|
||||||
List<Long> orderIds = productionStatusMapper.selectOrderIds(pageReqVO,getUserOrganId()).stream().map(m->m.getId()).collect(Collectors.toList());
|
List<Long> orderIds = productionStatusMapper.selectOrderIds(pageReqVO,getUserOrganId()).stream().map(OrderDO::getId).collect(Collectors.toList());
|
||||||
|
|
||||||
if(orderIds.isEmpty()){
|
if(orderIds.isEmpty()){
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// List<OrderProcessStepNDO> orderProcessStepNDOS = processStepMapper.selectByOrderIds(orderIds, getUserOrganId(), ProcessProcessingTypeEnum.PACK.getNumber());
|
||||||
|
//
|
||||||
|
// List<Long> orderIdList = orderProcessStepNDOS.stream().map(OrderProcessStepNDO::getOrderId).distinct().toList();
|
||||||
|
//
|
||||||
|
// if(orderIdList.isEmpty()){
|
||||||
|
// return null;
|
||||||
|
// }
|
||||||
|
|
||||||
// 查询打包首页分页数据信息,总的板件数量信息
|
// 查询打包首页分页数据信息,总的板件数量信息
|
||||||
IPage<PackRespVO> packRespVOS = productionStatusMapper.selectOrderPlate(page,orderIds,getUserOrganId());
|
IPage<PackRespVO> packRespVOS = productionStatusMapper.selectOrderPlate(page,orderIds,getUserOrganId());
|
||||||
|
|
||||||
@@ -130,8 +138,15 @@ public class PackServiceImpl implements PackService {
|
|||||||
record.setPackPieceCount(plateNum.stream().filter(f -> Objects.equals(f.getId(), record.getId())).mapToLong(PackRespVO::getPackPieceCount).sum());
|
record.setPackPieceCount(plateNum.stream().filter(f -> Objects.equals(f.getId(), record.getId())).mapToLong(PackRespVO::getPackPieceCount).sum());
|
||||||
// 待处理量
|
// 待处理量
|
||||||
record.setPendingNum(record.getTotalPieceCount() - record.getPackPieceCount());
|
record.setPendingNum(record.getTotalPieceCount() - record.getPackPieceCount());
|
||||||
}
|
|
||||||
|
|
||||||
|
// if(record.getPackCount() == 0) {
|
||||||
|
// record.setStatus(OrderPackStatusEnums.UNPACKAGED.getStatus());
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// record.setStatus(record.getTotalPieceCount().equals(record.getPackPieceCount()) ?
|
||||||
|
// OrderPackStatusEnums.PACKAGED.getStatus() : OrderPackStatusEnums.INPACKAGING.getStatus());
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
if (CollectionUtil.isEmpty(packRespVOS.getRecords())) {
|
if (CollectionUtil.isEmpty(packRespVOS.getRecords())) {
|
||||||
return new PageResult<>();
|
return new PageResult<>();
|
||||||
@@ -424,6 +439,7 @@ public class PackServiceImpl implements PackService {
|
|||||||
// 判断当前生产单的板材和配件是否已全部打包且当前生产单的包裹已全部封包
|
// 判断当前生产单的板材和配件是否已全部打包且当前生产单的包裹已全部封包
|
||||||
if(validateOrderPack(packageVO.getOrderId())){
|
if(validateOrderPack(packageVO.getOrderId())){
|
||||||
|
|
||||||
|
// 修改生产单的打包状态
|
||||||
updateOrderStatus(packageVO.getOrderId());
|
updateOrderStatus(packageVO.getOrderId());
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -458,32 +474,32 @@ public class PackServiceImpl implements PackService {
|
|||||||
public void updateOrderStatus(Long orderId) {
|
public void updateOrderStatus(Long orderId) {
|
||||||
|
|
||||||
OrderDO orderDO = productionProcessMapper.selectById(orderId);
|
OrderDO orderDO = productionProcessMapper.selectById(orderId);
|
||||||
|
|
||||||
if(orderDO.getFinishTime() != null){
|
if(orderDO.getFinishTime() != null){
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 判断正确,修改当前生产单对应的打包的工序状态
|
// // 判断正确,修改当前生产单对应的打包的工序状态
|
||||||
OrderProcessStepNDO orderProcessStepNDO = processStepMapper.selectOrderProcess(orderId, getUserOrganId(), ProcessProcessingTypeEnum.PACK.getNumber());
|
// OrderProcessStepNDO orderProcessStepNDO = processStepMapper.selectOrderProcess(orderId, getUserOrganId(), ProcessProcessingTypeEnum.PACK.getNumber());
|
||||||
|
//
|
||||||
|
// if(orderProcessStepNDO == null){
|
||||||
|
// return;
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// // 工序加工添加负责人
|
||||||
|
// String nickname = getLoginUser().getNickname();
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// BigDecimal salary = productionProcessService.calculateSalary(orderProcessStepNDO.getId(), null);
|
||||||
|
//
|
||||||
|
// // 修改生产明细表和步骤表的工序状态
|
||||||
|
// processStepMapper.updateStatus(orderProcessStepNDO.getId(), nickname, salary);
|
||||||
|
//
|
||||||
|
// processStepItemMapper.updateStatus(orderProcessStepNDO.getId());
|
||||||
|
|
||||||
if(orderProcessStepNDO == null){
|
// 修改生产单的打包状态未已打包
|
||||||
return;
|
orderDO.setPackaged(OrderPackageStatusEnum.PACKAGED.getStatus());
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// 工序加工添加负责人
|
|
||||||
String nickname = getLoginUser().getNickname();
|
|
||||||
|
|
||||||
|
|
||||||
BigDecimal salary = productionProcessService.calculateSalary(orderProcessStepNDO.getId(), null);
|
|
||||||
|
|
||||||
// 修改生产明细表和步骤表的工序状态
|
|
||||||
processStepMapper.updateStatus(orderProcessStepNDO.getId(), nickname, salary);
|
|
||||||
|
|
||||||
processStepItemMapper.updateStatus(orderProcessStepNDO.getId());
|
|
||||||
|
|
||||||
// 修改生产的状态为生产完成
|
|
||||||
orderDO.setStatus(OrderStatusEnum.FINISH_PRODUCTION.getStatus());
|
|
||||||
orderDO.setFinishTime(LocalDateTime.now());
|
|
||||||
|
|
||||||
productionProcessMapper.updateById(orderDO);
|
productionProcessMapper.updateById(orderDO);
|
||||||
|
|
||||||
|
|||||||
+8
-11
@@ -43,7 +43,7 @@
|
|||||||
<result property="dealerPhoneNumber" column="dealerPhoneNumber"/>
|
<result property="dealerPhoneNumber" column="dealerPhoneNumber"/>
|
||||||
<result property="orderDate" column="orderDate"/>
|
<result property="orderDate" column="orderDate"/>
|
||||||
<result property="deliveryDate" column="deliveryDate"/>
|
<result property="deliveryDate" column="deliveryDate"/>
|
||||||
<result property="status" column="status"/>
|
<result property="packaged" column="packaged"/>
|
||||||
<result property="customer" column="customer"/>
|
<result property="customer" column="customer"/>
|
||||||
<result property="address" column="address"/>
|
<result property="address" column="address"/>
|
||||||
<result property="phoneNumber" column="phoneNumber"/>
|
<result property="phoneNumber" column="phoneNumber"/>
|
||||||
@@ -75,7 +75,7 @@
|
|||||||
o.address as address,
|
o.address as address,
|
||||||
o.salesman as salesman,
|
o.salesman as salesman,
|
||||||
o.splitter as splitter,
|
o.splitter as splitter,
|
||||||
o.status as status,
|
o.packaged as packaged,
|
||||||
count(distinct oi.plate_id) as totalPieceCount
|
count(distinct oi.plate_id) as totalPieceCount
|
||||||
|
|
||||||
FROM `orders` o
|
FROM `orders` o
|
||||||
@@ -88,7 +88,7 @@
|
|||||||
#{id}
|
#{id}
|
||||||
</foreach>
|
</foreach>
|
||||||
|
|
||||||
group by orderNo,customOrderNo,dealer,createTime,deliveryDate,customer,phoneNumber,address,salesman,splitter,status,dealerPhoneNumber,orderDate
|
group by orderNo,customOrderNo,dealer,createTime,deliveryDate,customer,phoneNumber,address,salesman,splitter,packaged,dealerPhoneNumber,orderDate
|
||||||
|
|
||||||
|
|
||||||
</select>
|
</select>
|
||||||
@@ -146,18 +146,13 @@
|
|||||||
|
|
||||||
organ_id =#{organId}
|
organ_id =#{organId}
|
||||||
and deleted = false
|
and deleted = false
|
||||||
and status in (2,3,4)
|
|
||||||
|
|
||||||
<if test="pageReqVO.orderId !=null">
|
<if test="pageReqVO.orderId !=null">
|
||||||
and id like concat('%', #{pageReqVO.orderId},'%')
|
and id like concat('%', #{pageReqVO.orderId},'%')
|
||||||
</if>
|
</if>
|
||||||
|
|
||||||
<if test="pageReqVO.status == false ">
|
<if test="pageReqVO.status !=null ">
|
||||||
and status in (2,3)
|
and packaged = #{pageReqVO.status}
|
||||||
</if>
|
|
||||||
|
|
||||||
<if test="pageReqVO.status == true">
|
|
||||||
and status in (4)
|
|
||||||
</if>
|
</if>
|
||||||
|
|
||||||
<if test="pageReqVO.customOrderNo !=null">
|
<if test="pageReqVO.customOrderNo !=null">
|
||||||
@@ -182,5 +177,7 @@
|
|||||||
|
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<!-- <if test="pageReqVO.status == true">
|
||||||
|
and status in (4)
|
||||||
|
</if>-->
|
||||||
</mapper>
|
</mapper>
|
||||||
+1
-1
@@ -24,7 +24,7 @@ public class DataSourceFiledReqVO {
|
|||||||
private String name;
|
private String name;
|
||||||
|
|
||||||
@Schema(description = "字段key")
|
@Schema(description = "字段key")
|
||||||
private String key;
|
private String keyName;
|
||||||
|
|
||||||
@Schema(description = "下一层级结构")
|
@Schema(description = "下一层级结构")
|
||||||
private List<DataSourceFiledReqVO> children;
|
private List<DataSourceFiledReqVO> children;
|
||||||
|
|||||||
+1
-1
@@ -24,7 +24,7 @@ public class DataSourceSaveReqVO {
|
|||||||
private String name;
|
private String name;
|
||||||
|
|
||||||
@Schema(description = "数据源的字段key", requiredMode = Schema.RequiredMode.REQUIRED)
|
@Schema(description = "数据源的字段key", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
private String key;
|
private String keyName;
|
||||||
|
|
||||||
@Schema(description = "数据源的父ID", requiredMode = Schema.RequiredMode.REQUIRED)
|
@Schema(description = "数据源的父ID", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
private Long parentId;
|
private Long parentId;
|
||||||
|
|||||||
+1
-2
@@ -37,6 +37,5 @@ public class DataSourceFiledDO {
|
|||||||
/**
|
/**
|
||||||
* 字段key
|
* 字段key
|
||||||
*/
|
*/
|
||||||
@TableField("`key`")
|
private String keyName;
|
||||||
private String key;
|
|
||||||
}
|
}
|
||||||
|
|||||||
+5
-5
@@ -46,14 +46,14 @@ public class DataSourceServiceImpl implements DataSourceService {
|
|||||||
|
|
||||||
// 提取 SourceField 中的 key 列表
|
// 提取 SourceField 中的 key 列表
|
||||||
List<String> keyList = createReqVO.stream()
|
List<String> keyList = createReqVO.stream()
|
||||||
.map(DataSourceSaveReqVO::getKey)
|
.map(DataSourceSaveReqVO::getKeyName)
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
|
|
||||||
// 根据 key 列表查询对应的 DataSourceFiledDO 列表并转换为 Map
|
// 根据 key 列表查询对应的 DataSourceFiledDO 列表并转换为 Map
|
||||||
Map<String, List<DataSourceFiledDO>> dataSourceFiledDoMap = dataSourceFiledMapper
|
Map<String, List<DataSourceFiledDO>> dataSourceFiledDoMap = dataSourceFiledMapper
|
||||||
.selectFiledListByKey(keyList)
|
.selectFiledListByKey(keyList)
|
||||||
.stream()
|
.stream()
|
||||||
.collect(Collectors.groupingBy(DataSourceFiledDO::getKey));
|
.collect(Collectors.groupingBy(DataSourceFiledDO::getKeyName));
|
||||||
|
|
||||||
List<DataSourceFiledDO> insertFiledDoS = new ArrayList<>();
|
List<DataSourceFiledDO> insertFiledDoS = new ArrayList<>();
|
||||||
|
|
||||||
@@ -62,7 +62,7 @@ public class DataSourceServiceImpl implements DataSourceService {
|
|||||||
// 遍历 SourceFields 进行插入或更新操作
|
// 遍历 SourceFields 进行插入或更新操作
|
||||||
for (DataSourceSaveReqVO sourceField : createReqVO) {
|
for (DataSourceSaveReqVO sourceField : createReqVO) {
|
||||||
|
|
||||||
List<DataSourceFiledDO> existingFiledDoS = dataSourceFiledDoMap.get(sourceField.getKey());
|
List<DataSourceFiledDO> existingFiledDoS = dataSourceFiledDoMap.get(sourceField.getKeyName());
|
||||||
|
|
||||||
if (existingFiledDoS != null) {
|
if (existingFiledDoS != null) {
|
||||||
DataSourceFiledDO dataSourceFiledDO = existingFiledDoS.get(0);
|
DataSourceFiledDO dataSourceFiledDO = existingFiledDoS.get(0);
|
||||||
@@ -75,7 +75,7 @@ public class DataSourceServiceImpl implements DataSourceService {
|
|||||||
} else {
|
} else {
|
||||||
|
|
||||||
insertFiledDoS.add(DataSourceFiledDO.builder()
|
insertFiledDoS.add(DataSourceFiledDO.builder()
|
||||||
.key(sourceField.getKey())
|
.keyName(sourceField.getKeyName())
|
||||||
.sourceId(String.valueOf(sourceField.getParentId()))
|
.sourceId(String.valueOf(sourceField.getParentId()))
|
||||||
.name(sourceField.getName())
|
.name(sourceField.getName())
|
||||||
.build());
|
.build());
|
||||||
@@ -422,7 +422,7 @@ public class DataSourceServiceImpl implements DataSourceService {
|
|||||||
|
|
||||||
// 获取没有key的节点ID
|
// 获取没有key的节点ID
|
||||||
List<Long> ids = parentList.stream()
|
List<Long> ids = parentList.stream()
|
||||||
.filter(f -> f.getKey() == null)
|
.filter(f -> f.getKeyName() == null)
|
||||||
.map(DataSourceFiledReqVO::getId)
|
.map(DataSourceFiledReqVO::getId)
|
||||||
.distinct()
|
.distinct()
|
||||||
.toList();
|
.toList();
|
||||||
|
|||||||
+2
-2
@@ -11,12 +11,12 @@
|
|||||||
<result property="name" column="field_name"/>
|
<result property="name" column="field_name"/>
|
||||||
<result property="sourceId" column="field_source_id"/>
|
<result property="sourceId" column="field_source_id"/>
|
||||||
<result property="id" column="field_id"/>
|
<result property="id" column="field_id"/>
|
||||||
<result property="key" column="field_key"/>
|
<result property="keyName" column="field_key"/>
|
||||||
</collection>
|
</collection>
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<select id="selectListVO" resultMap="map">
|
<select id="selectListVO" resultMap="map">
|
||||||
select a.*, b.id field_id, b.name field_name, b.source_id field_source_id, b.key field_key
|
select a.*, b.id field_id, b.name field_name, b.source_id field_source_id, b.keyName field_key
|
||||||
from system_data_source a
|
from system_data_source a
|
||||||
left join system_data_source_field b on a.id = b.source_id
|
left join system_data_source_field b on a.id = b.source_id
|
||||||
where a.type in (1,2)
|
where a.type in (1,2)
|
||||||
|
|||||||
Reference in New Issue
Block a user