Commit b9d47497 authored by Smile's avatar Smile
parents aa45a105 a702d8a5
......@@ -241,6 +241,11 @@ public interface OrderWarehouseInService extends IService<OrderWarehouseInDO> {
*/
void noNeedToPack(Long orderItemId);
/**
* 批量不需要打包
* @param orderItemIds
*/
void noNeedToPacks(List<Long> orderItemIds);
/**
* 完成备货请求
......@@ -252,7 +257,7 @@ public interface OrderWarehouseInService extends IService<OrderWarehouseInDO> {
/**
* 获取打包后的订单首次完成入仓的统计数据
*
*
* @param orderId
* @return
*/
......
......@@ -5356,6 +5356,14 @@ public class OrderWarehouseInServiceImpl extends AbstractService<OrderWarehouseI
orderBusinessService.addOrderOperateLog(orderId, "仓库操作", "无需打包-品名[" + orderItemDO.getProdTitleZh() + "]", "");
}
@Override
@Transactional(rollbackFor = Exception.class)
public void noNeedToPacks(List<Long> orderItemIds) {
for (Long orderItemId : orderItemIds) {
noNeedToPack(orderItemId);
}
}
/**
* 完成备货
*
......
......@@ -374,6 +374,13 @@ public class OrderWarehouseInController {
return success(true);
}
@PostMapping("/no-need-to-packs")
@ApiOperation("批量无需打包")
@Idempotent(timeout = 2)
public CommonResult<Boolean> noNeedToPacks(@RequestBody List<Long> orderItemIds) {
orderWarehouseInService.noNeedToPacks(orderItemIds);
return success(true);
}
@PutMapping("/finish-stocked")
@ApiOperation("完成备货")
......
......@@ -250,7 +250,7 @@ public class ShipmentLoadExcelExportListener2 {
if(orderInfo.getCustomsType()!=null){
preloadDto.setCustomsType(DictFrameworkUtils.getDictDataFromCache("customs_type",orderInfo.getCustomsType()+"").getLabel());
if (CustomsTypeEnum.CUSTOMS_TYPE_3.getValue().equals(orderInfo.getCustomsType())){
Integer color = Integer.valueOf(IndexedColors.BLUE1.index);
Integer color = Integer.valueOf(IndexedColors.ROYAL_BLUE.index);
if (prodAttrTag){
color=Integer.valueOf(IndexedColors.ROYAL_BLUE.index);
}
......
package cn.iocoder.yudao.module.shipment.utils;
import cn.iocoder.yudao.module.shipment.dto.AirLoadDto;
import cn.iocoder.yudao.module.shipment.dto.PreloadDto;
import com.alibaba.excel.metadata.CellData;
import com.alibaba.excel.metadata.Head;
import com.alibaba.excel.write.merge.AbstractMergeStrategy;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.Sheet;
import com.alibaba.excel.write.metadata.holder.WriteSheetHolder;
import com.alibaba.excel.write.metadata.holder.WriteTableHolder;
import org.apache.poi.ss.usermodel.*;
import org.apache.poi.ss.util.CellRangeAddress;
import org.springframework.util.CollectionUtils;
......@@ -34,8 +35,6 @@ public class CustomAirLoadMergeStrategyNew extends AbstractMergeStrategy {
private List<Integer> mergePkgCountList;
private int mergeType;
/**
......@@ -46,14 +45,31 @@ public class CustomAirLoadMergeStrategyNew extends AbstractMergeStrategy {
// 需要开始合并单元格的首行index
private Integer rowIndex;
private Map<String,Integer> colorMap;
// exportDataList为待合并目标列的值 partMerge为另外一种合并方式计算好的合并行数,mergeType 合并类型 1为订单维度合并 2为入仓记录维度的合并
public CustomAirLoadMergeStrategyNew(List<AirLoadDto> exportDataList, List<Integer> partMergeList, List<Integer> colorRowList,List<Integer> mergePkgCountList, Integer targetColumnIndex, int mergeType) {
public CustomAirLoadMergeStrategyNew(List<AirLoadDto> exportDataList, List<Integer> partMergeList, List<Integer> colorRowList,List<Integer> mergePkgCountList, Integer targetColumnIndex, int mergeType, Map<String,Integer> colorMap) {
this.exportFieldGroupCountList = getGroupCountList(exportDataList,targetColumnIndex);
this.partMergeList = partMergeList;
this.mergeType = mergeType;
this.targetColumnIndex = targetColumnIndex;
this.colorRowList = colorRowList;
this.mergePkgCountList = mergePkgCountList;
this.colorMap = colorMap;
}
@Override
public void afterCellDispose(WriteSheetHolder writeSheetHolder, WriteTableHolder writeTableHolder, List<CellData> cellDataList, Cell cell, Head head, Integer relativeRowIndex, Boolean isHead) {
Workbook workbook = writeSheetHolder.getSheet().getWorkbook();
if (colorRowList.contains(cell.getRowIndex()) && cell.getColumnIndex() == targetColumnIndex) {
CellStyle cellStyle = workbook.createCellStyle();
cellStyle.setFillForegroundColor(IndexedColors.fromInt(colorMap.get(String.valueOf(cell.getRowIndex()))).index);
cellStyle.setFillPattern(FillPatternType.SOLID_FOREGROUND);
cell.setCellStyle(cellStyle);
}
if (!isHead) {
this.merge(writeSheetHolder.getSheet(), cell, head, relativeRowIndex);
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment