Commit b1227055 authored by lanbaoming's avatar lanbaoming

2024-06-12提交发布

parent c35f1042
...@@ -51,6 +51,7 @@ ...@@ -51,6 +51,7 @@
<mapstruct.version>1.4.1.Final</mapstruct.version> <mapstruct.version>1.4.1.Final</mapstruct.version>
<hutool.version>5.6.1</hutool.version> <hutool.version>5.6.1</hutool.version>
<pinyin4j.version>2.5.0</pinyin4j.version> <pinyin4j.version>2.5.0</pinyin4j.version>
<!--lanbm 2024-06-11 修改版本 2.2.7 -->
<easyexcel.verion>2.2.7</easyexcel.verion> <easyexcel.verion>2.2.7</easyexcel.verion>
<ooxml.verion>1.0</ooxml.verion> <ooxml.verion>1.0</ooxml.verion>
<velocity.version>2.2</velocity.version> <velocity.version>2.2</velocity.version>
......
...@@ -4,7 +4,7 @@ import com.alibaba.excel.write.handler.SheetWriteHandler; ...@@ -4,7 +4,7 @@ import com.alibaba.excel.write.handler.SheetWriteHandler;
import com.alibaba.excel.write.metadata.holder.WriteSheetHolder; import com.alibaba.excel.write.metadata.holder.WriteSheetHolder;
import com.alibaba.excel.write.metadata.holder.WriteWorkbookHolder; import com.alibaba.excel.write.metadata.holder.WriteWorkbookHolder;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.apache.poi.POIXMLDocumentPart; //import org.apache.poi.POIXMLDocumentPart;
import org.apache.poi.openxml4j.opc.PackagePartName; import org.apache.poi.openxml4j.opc.PackagePartName;
import org.apache.poi.openxml4j.opc.PackageRelationship; import org.apache.poi.openxml4j.opc.PackageRelationship;
import org.apache.poi.openxml4j.opc.TargetMode; import org.apache.poi.openxml4j.opc.TargetMode;
......
...@@ -685,10 +685,16 @@ public class OrderQueryServiceImpl implements OrderQueryService { ...@@ -685,10 +685,16 @@ public class OrderQueryServiceImpl implements OrderQueryService {
dto.setOrderItemVOList(backVOList); dto.setOrderItemVOList(backVOList);
} }
// 订单动态 // 订单动态 lanbm 2024-06-11 添加注释
List<OrderTimeDO> orderTimeList = orderTimeMapper.selectList(new LambdaQueryWrapper<OrderTimeDO>().eq(OrderTimeDO::getOrderId, orderId).orderByDesc(OrderTimeDO::getId)); // 订单的到仓时间 去动态值 businessTime
List<OrderTimeDO> orderTimeList =
orderTimeMapper.selectList(
new LambdaQueryWrapper<OrderTimeDO>().eq(OrderTimeDO::getOrderId, orderId).orderByDesc(OrderTimeDO::getId));
if (CollectionUtil.isNotEmpty(orderTimeList)) { if (CollectionUtil.isNotEmpty(orderTimeList)) {
dto.setOrderTimeVOList(OrderTimeConvert.INSTANCE.convertList(orderTimeList)); //lanbm 2024-06-11 添加的函数
getDaoCanTiam(orderTimeList);
dto.setOrderTimeVOList(OrderTimeConvert.INSTANCE.convertList(
orderTimeList));
} }
if (Objects.equals(TransportTypeShortEnum.SEA_CONTAINER.getValue(), dto.getTransportId()) if (Objects.equals(TransportTypeShortEnum.SEA_CONTAINER.getValue(), dto.getTransportId())
|| Objects.equals(TransportTypeShortEnum.MARINE_CONTAINER.getValue(), dto.getTransportId())) { || Objects.equals(TransportTypeShortEnum.MARINE_CONTAINER.getValue(), dto.getTransportId())) {
...@@ -716,6 +722,28 @@ public class OrderQueryServiceImpl implements OrderQueryService { ...@@ -716,6 +722,28 @@ public class OrderQueryServiceImpl implements OrderQueryService {
return dto; return dto;
} }
/*
lanbm 2024-06-11 添加的函数
*/
private void getDaoCanTiam(List<OrderTimeDO> orderTimeList) {
/*
List<OrderTimeDO> list = orderTimeList.stream().
filter(i -> i.getTitleZh() == "到仓").collect(Collectors.toList());
if (CollectionUtil.isEmpty(list)) {
return;
}*/
for (OrderTimeDO i:orderTimeList
) {
if(i.getTitleZh()!=null&&i.getTitleZh()=="到仓")
{
//i.getBusinessTime();
long l=i.getOrderId();
}
}
}
@NotNull @NotNull
private List<OrderItemBackVO> fillOrderItemProperties(List<OrderItemBackVO> backVOList) { private List<OrderItemBackVO> fillOrderItemProperties(List<OrderItemBackVO> backVOList) {
if (CollectionUtil.isEmpty(backVOList)) { if (CollectionUtil.isEmpty(backVOList)) {
...@@ -750,16 +778,16 @@ public class OrderQueryServiceImpl implements OrderQueryService { ...@@ -750,16 +778,16 @@ public class OrderQueryServiceImpl implements OrderQueryService {
item.setQQuantity(BigDecimal.ZERO.toString()); item.setQQuantity(BigDecimal.ZERO.toString());
} }
//入仓类型,多个用逗号分隔 //入仓类型,多个用逗号分隔
OrderItemBackVO warehouseInDO = orderWarehouseInMapper.getWarehouseInByItemIdAndOrderId(item.getOrderId(),item.getOrderItemId()); OrderItemBackVO warehouseInDO = orderWarehouseInMapper.getWarehouseInByItemIdAndOrderId(item.getOrderId(), item.getOrderItemId());
if(Objects.nonNull(warehouseInDO) && StringUtils.isNotBlank(warehouseInDO.getWarehouseType())){ if (Objects.nonNull(warehouseInDO) && StringUtils.isNotBlank(warehouseInDO.getWarehouseType())) {
item.setWarehouseType(warehouseInDO.getWarehouseType()) ; item.setWarehouseType(warehouseInDO.getWarehouseType());
} }
//入仓包装单位,多个用逗号分隔 //入仓包装单位,多个用逗号分隔
if(Objects.nonNull(warehouseInDO) && StringUtils.isNotBlank(warehouseInDO.getSpecificationType())){ if (Objects.nonNull(warehouseInDO) && StringUtils.isNotBlank(warehouseInDO.getSpecificationType())) {
item.setSpecificationType(warehouseInDO.getSpecificationType()) ; item.setSpecificationType(warehouseInDO.getSpecificationType());
} }
if(Objects.nonNull(warehouseInDO) && StringUtils.isNotBlank(warehouseInDO.getWarehouseRecordRemark())){ if (Objects.nonNull(warehouseInDO) && StringUtils.isNotBlank(warehouseInDO.getWarehouseRecordRemark())) {
item.setWarehouseRecordRemark(warehouseInDO.getWarehouseRecordRemark()) ; item.setWarehouseRecordRemark(warehouseInDO.getWarehouseRecordRemark());
} }
...@@ -895,7 +923,7 @@ public class OrderQueryServiceImpl implements OrderQueryService { ...@@ -895,7 +923,7 @@ public class OrderQueryServiceImpl implements OrderQueryService {
if (Objects.isNull(query.getLang())) { if (Objects.isNull(query.getLang())) {
query.setLang(I18nMessage.getLang()); query.setLang(I18nMessage.getLang());
} }
caseStatus(query.getStatus(),query); caseStatus(query.getStatus(), query);
IPage<OrderBackPageVO> mpPage = MyBatisUtils.buildPage(page); IPage<OrderBackPageVO> mpPage = MyBatisUtils.buildPage(page);
log.warn(I18nMessage.getLang().toString()); log.warn(I18nMessage.getLang().toString());
...@@ -907,31 +935,29 @@ public class OrderQueryServiceImpl implements OrderQueryService { ...@@ -907,31 +935,29 @@ public class OrderQueryServiceImpl implements OrderQueryService {
} }
public void caseStatus(List<Integer> status, OrderQueryDTO query) {
if (CollectionUtils.isNotEmpty(status) && status.size() > 0) {
List<Integer> statusList = new ArrayList<>();
public void caseStatus(List<Integer> status,OrderQueryDTO query){ status.forEach(statu -> {
if (CollectionUtils.isNotEmpty(status) && status.size()>0) { if (statu > 10000) {
List<Integer> statusList =new ArrayList<>() ; combinedState(statu, query, statusList);
status.forEach(statu->{
if(statu>10000){
combinedState(statu, query,statusList);
} }
}); });
statusList.stream().distinct(); statusList.stream().distinct();
List<Integer> list= new ArrayList<>() ; List<Integer> list = new ArrayList<>();
list.addAll(status.stream().filter(s->s <10000).collect(Collectors.toList())) ; list.addAll(status.stream().filter(s -> s < 10000).collect(Collectors.toList()));
list.addAll(statusList.stream().distinct().collect(Collectors.toList())); list.addAll(statusList.stream().distinct().collect(Collectors.toList()));
query.setStatusList(list) ; query.setStatusList(list);
}else if(CollectionUtils.isNotEmpty(status) && status.size()==0){ } else if (CollectionUtils.isNotEmpty(status) && status.size() == 0) {
status =null; status = null;
} }
} }
private void combinedState(Integer asStatus, OrderQueryDTO query, List<Integer> statusList) {
private void combinedState(Integer asStatus, OrderQueryDTO query,List<Integer> statusList) {
switch (asStatus) { switch (asStatus) {
...@@ -946,27 +972,27 @@ public class OrderQueryServiceImpl implements OrderQueryService { ...@@ -946,27 +972,27 @@ public class OrderQueryServiceImpl implements OrderQueryService {
//this.status = 5; //this.status = 5;
statusList.add(5); statusList.add(5);
//query.setTransportId(3); // 空运待出查询,只查空运的订单 //query.setTransportId(3); // 空运待出查询,只查空运的订单
if(Objects.nonNull(query.getTransportId())){ if (Objects.nonNull(query.getTransportId())) {
query.setTransportId(3); query.setTransportId(3);
} }
query.setAirShipment(1); query.setAirShipment(1);
//this.auditType = 0; //this.auditType = 0;
if(CollectionUtils.isEmpty(query.getAuditType())){ if (CollectionUtils.isEmpty(query.getAuditType())) {
List<Integer> audits= new ArrayList<>(); List<Integer> audits = new ArrayList<>();
query.setAuditType(audits) ; query.setAuditType(audits);
query.getAuditType().add(0) ; query.getAuditType().add(0);
}else { } else {
query.getAuditType().add(0) ; query.getAuditType().add(0);
} }
//this.abnormalState = 0; //this.abnormalState = 0;
if(CollectionUtils.isEmpty(query.getAbnormalState())){ if (CollectionUtils.isEmpty(query.getAbnormalState())) {
List<Integer> audits= new ArrayList<>(); List<Integer> audits = new ArrayList<>();
query.setAbnormalState(audits); query.setAbnormalState(audits);
query.getAbnormalState().add(0) ; query.getAbnormalState().add(0);
}else { } else {
query.getAbnormalState().add(0) ; query.getAbnormalState().add(0);
} }
break; break;
...@@ -975,20 +1001,20 @@ public class OrderQueryServiceImpl implements OrderQueryService { ...@@ -975,20 +1001,20 @@ public class OrderQueryServiceImpl implements OrderQueryService {
//this.status = 5; //this.status = 5;
statusList.add(5); statusList.add(5);
//query.setTransportId(3); // 空运待出查询,只查空运的订单 //query.setTransportId(3); // 空运待出查询,只查空运的订单
if(Objects.nonNull(query.getTransportId())){ if (Objects.nonNull(query.getTransportId())) {
query.setTransportId(3); query.setTransportId(3);
} }
query.setAirShipment(12) ; // 可出、备货中 query.setAirShipment(12); // 可出、备货中
break; break;
case 10503: case 10503:
// 空运已备货 // 空运已备货
//this.status = 5; //this.status = 5;
statusList.add(5); statusList.add(5);
//query.setTransportId(3); // 空运待出查询,只查空运的订单 //query.setTransportId(3); // 空运待出查询,只查空运的订单
if(Objects.nonNull(query.getTransportId())){ if (Objects.nonNull(query.getTransportId())) {
query.setTransportId(3); query.setTransportId(3);
} }
query.setAirShipment(4) ; // 已备货 query.setAirShipment(4); // 已备货
break; break;
case 10504: case 10504:
// 待排单 // 待排单
...@@ -996,29 +1022,29 @@ public class OrderQueryServiceImpl implements OrderQueryService { ...@@ -996,29 +1022,29 @@ public class OrderQueryServiceImpl implements OrderQueryService {
statusList.add(5); statusList.add(5);
if (Objects.nonNull(query.getTransportId()) && query.getTransportId() == 3) { if (Objects.nonNull(query.getTransportId()) && query.getTransportId() == 3) {
// 空运无需判断备货状态 可出、备货中、已备货 // 空运无需判断备货状态 可出、备货中、已备货
query.setAirShipment(10) ; query.setAirShipment(10);
}else { } else {
// 兼容空运已入仓的可出、备货中、已备货,且无异常无审批,海运的已入仓无异常无审批 // 兼容空运已入仓的可出、备货中、已备货,且无异常无审批,海运的已入仓无异常无审批
query.setAirShipment(20) ; query.setAirShipment(20);
} }
//this.auditType = 0; //this.auditType = 0;
if(CollectionUtils.isEmpty(query.getAuditType())){ if (CollectionUtils.isEmpty(query.getAuditType())) {
List<Integer> audits= new ArrayList<>(); List<Integer> audits = new ArrayList<>();
query.setAuditType(audits) ; query.setAuditType(audits);
query.getAuditType().add(0);
} else {
query.getAuditType().add(0); query.getAuditType().add(0);
}else {
query.getAuditType().add(0) ;
} }
//this.abnormalState = 0; //this.abnormalState = 0;
if(CollectionUtils.isEmpty(query.getAbnormalState())){ if (CollectionUtils.isEmpty(query.getAbnormalState())) {
List<Integer> audits= new ArrayList<>(); List<Integer> audits = new ArrayList<>();
query.setAbnormalState(audits); query.setAbnormalState(audits);
query.getAbnormalState().add(0) ; query.getAbnormalState().add(0);
}else { } else {
query.getAbnormalState().add(0) ; query.getAbnormalState().add(0);
} }
break; break;
case 132411: case 132411:
...@@ -1026,7 +1052,7 @@ public class OrderQueryServiceImpl implements OrderQueryService { ...@@ -1026,7 +1052,7 @@ public class OrderQueryServiceImpl implements OrderQueryService {
//this.status = 32; //this.status = 32;
statusList.add(32); statusList.add(32);
//query.setTransportId(3); // 空运待出查询,只查空运的订单 //query.setTransportId(3); // 空运待出查询,只查空运的订单
if(Objects.nonNull(query.getTransportId())){ if (Objects.nonNull(query.getTransportId())) {
query.setTransportId(3); query.setTransportId(3);
} }
query.setShipmentState(411); query.setShipmentState(411);
...@@ -1036,7 +1062,7 @@ public class OrderQueryServiceImpl implements OrderQueryService { ...@@ -1036,7 +1062,7 @@ public class OrderQueryServiceImpl implements OrderQueryService {
//this.status = 32; //this.status = 32;
statusList.add(32); statusList.add(32);
//query.setTransportId(3); // 空运待出查询,只查空运的订单 //query.setTransportId(3); // 空运待出查询,只查空运的订单
if(Objects.nonNull(query.getTransportId())){ if (Objects.nonNull(query.getTransportId())) {
query.setTransportId(3); query.setTransportId(3);
} }
query.setShipmentState(412); query.setShipmentState(412);
...@@ -1045,21 +1071,21 @@ public class OrderQueryServiceImpl implements OrderQueryService { ...@@ -1045,21 +1071,21 @@ public class OrderQueryServiceImpl implements OrderQueryService {
// 空运已理货 // 空运已理货
//this.status = 32; //this.status = 32;
statusList.add(32); statusList.add(32);
// 空运待出查询,只查空运的订单 // 空运待出查询,只查空运的订单
if(Objects.nonNull(query.getTransportId())){ if (Objects.nonNull(query.getTransportId())) {
query.setTransportId(3); query.setTransportId(3);
} }
query.setShipmentState( 409); query.setShipmentState(409);
break; break;
case 118428: case 118428:
// 空运已到港 // 空运已到港
//this.status = 18; //this.status = 18;
statusList.add(18); statusList.add(18);
//query.setTransportId(3); // 空运待出查询,只查空运的订单 //query.setTransportId(3); // 空运待出查询,只查空运的订单
if(Objects.nonNull(query.getTransportId())){ if (Objects.nonNull(query.getTransportId())) {
query.setTransportId(3); query.setTransportId(3);
} }
query.setShipmentState( 428); query.setShipmentState(428);
break; break;
} }
...@@ -1085,7 +1111,7 @@ public class OrderQueryServiceImpl implements OrderQueryService { ...@@ -1085,7 +1111,7 @@ public class OrderQueryServiceImpl implements OrderQueryService {
@Override @Override
public PageResult<OrderBackPageVO> deptOrderPage1(OrderQueryDTO query, PageVO page) { public PageResult<OrderBackPageVO> deptOrderPage1(OrderQueryDTO query, PageVO page) {
query.setLang(I18nMessage.getLang()); query.setLang(I18nMessage.getLang());
caseStatus(query.getStatus(),query); caseStatus(query.getStatus(), query);
IPage<OrderBackPageVO> mpPage = MyBatisUtils.buildPage(page); IPage<OrderBackPageVO> mpPage = MyBatisUtils.buildPage(page);
long total = orderMapper.deptOrderCount1(query); long total = orderMapper.deptOrderCount1(query);
log.warn(I18nMessage.getLang().toString()); log.warn(I18nMessage.getLang().toString());
...@@ -1132,7 +1158,7 @@ public class OrderQueryServiceImpl implements OrderQueryService { ...@@ -1132,7 +1158,7 @@ public class OrderQueryServiceImpl implements OrderQueryService {
@Override @Override
public PageResult<OrderBackPageVO> adminCargoControlMyOrderPage(OrderQueryDTO query, PageVO page) { public PageResult<OrderBackPageVO> adminCargoControlMyOrderPage(OrderQueryDTO query, PageVO page) {
query.setLang(I18nMessage.getLang()); query.setLang(I18nMessage.getLang());
caseStatus(query.getStatus(),query); caseStatus(query.getStatus(), query);
IPage<OrderBackPageVO> mpPage = MyBatisUtils.buildPage(page); IPage<OrderBackPageVO> mpPage = MyBatisUtils.buildPage(page);
long total = orderMapper.adminCargoControlMyOrderCount(query); long total = orderMapper.adminCargoControlMyOrderCount(query);
log.warn(I18nMessage.getLang().toString()); log.warn(I18nMessage.getLang().toString());
...@@ -1698,7 +1724,7 @@ public class OrderQueryServiceImpl implements OrderQueryService { ...@@ -1698,7 +1724,7 @@ public class OrderQueryServiceImpl implements OrderQueryService {
@Override @Override
public StatisticsOrderVO statisticsMyOrder(OrderQueryDTO query) { public StatisticsOrderVO statisticsMyOrder(OrderQueryDTO query) {
caseStatus(query.getStatus(),query); caseStatus(query.getStatus(), query);
StatisticsOrderVO vo = orderMapper.statisticsMyOrder(query); StatisticsOrderVO vo = orderMapper.statisticsMyOrder(query);
if (Objects.nonNull(vo)) { if (Objects.nonNull(vo)) {
vo.setTotalVolume(new BigDecimal(vo.getTotalVolume()).setScale(2, RoundingMode.HALF_UP).toString()); vo.setTotalVolume(new BigDecimal(vo.getTotalVolume()).setScale(2, RoundingMode.HALF_UP).toString());
...@@ -1904,7 +1930,7 @@ public class OrderQueryServiceImpl implements OrderQueryService { ...@@ -1904,7 +1930,7 @@ public class OrderQueryServiceImpl implements OrderQueryService {
public FileDO makeMyOrderExcelFile(Long userId, Integer userType, OrderQueryDTO query) throws Exception { public FileDO makeMyOrderExcelFile(Long userId, Integer userType, OrderQueryDTO query) throws Exception {
DateTimeFormatter formatter = DateTimeFormatter.ofPattern(DATA_FORMAT); DateTimeFormatter formatter = DateTimeFormatter.ofPattern(DATA_FORMAT);
String nowTime = formatter.format(LocalDateTime.now()); String nowTime = formatter.format(LocalDateTime.now());
caseStatus(query.getStatus(),query); caseStatus(query.getStatus(), query);
String sheetName = query.getLang() == 0 ? "订单管理第{0}页" : "Order Management number {0}"; String sheetName = query.getLang() == 0 ? "订单管理第{0}页" : "Order Management number {0}";
if (Objects.isNull(userId)) { if (Objects.isNull(userId)) {
userId = 0L; userId = 0L;
...@@ -1987,7 +2013,7 @@ public class OrderQueryServiceImpl implements OrderQueryService { ...@@ -1987,7 +2013,7 @@ public class OrderQueryServiceImpl implements OrderQueryService {
*/ */
@Override @Override
public List<OrderExceptionStatisticsExcelVo> getOrderExceptionStatisticsExcel(OrderQueryDTO query) { public List<OrderExceptionStatisticsExcelVo> getOrderExceptionStatisticsExcel(OrderQueryDTO query) {
caseStatus(query.getStatus(),query); caseStatus(query.getStatus(), query);
return orderMapper.getOrderExceptionStatisticsList(query); return orderMapper.getOrderExceptionStatisticsList(query);
} }
...@@ -1998,7 +2024,7 @@ public class OrderQueryServiceImpl implements OrderQueryService { ...@@ -1998,7 +2024,7 @@ public class OrderQueryServiceImpl implements OrderQueryService {
*/ */
@Override @Override
public List<OrderHeavyExcelVo> getHeavyOrderExcelList(OrderQueryDTO query) { public List<OrderHeavyExcelVo> getHeavyOrderExcelList(OrderQueryDTO query) {
caseStatus(query.getStatus(),query); caseStatus(query.getStatus(), query);
return orderMapper.getHeavyOrderExcelList(query); return orderMapper.getHeavyOrderExcelList(query);
} }
...@@ -2010,7 +2036,7 @@ public class OrderQueryServiceImpl implements OrderQueryService { ...@@ -2010,7 +2036,7 @@ public class OrderQueryServiceImpl implements OrderQueryService {
*/ */
@Override @Override
public List<OrderReturnOrderExcelVo> getReturnOrderExcelList(OrderQueryDTO query) { public List<OrderReturnOrderExcelVo> getReturnOrderExcelList(OrderQueryDTO query) {
caseStatus(query.getStatus(),query); caseStatus(query.getStatus(), query);
return orderMapper.getReturnOrderExcelList(query); return orderMapper.getReturnOrderExcelList(query);
} }
...@@ -2022,7 +2048,7 @@ public class OrderQueryServiceImpl implements OrderQueryService { ...@@ -2022,7 +2048,7 @@ public class OrderQueryServiceImpl implements OrderQueryService {
*/ */
@Override @Override
public List<OrderSaleRepayExcelVo> getSaleRepayExcelList(OrderQueryDTO query) { public List<OrderSaleRepayExcelVo> getSaleRepayExcelList(OrderQueryDTO query) {
caseStatus(query.getStatus(),query); caseStatus(query.getStatus(), query);
return orderMapper.getSaleRepayExcelList(query); return orderMapper.getSaleRepayExcelList(query);
} }
...@@ -2034,7 +2060,7 @@ public class OrderQueryServiceImpl implements OrderQueryService { ...@@ -2034,7 +2060,7 @@ public class OrderQueryServiceImpl implements OrderQueryService {
*/ */
@Override @Override
public List<OrderCustomsDatasExcelVo> getCustomsDatasExcelList(OrderQueryDTO query) { public List<OrderCustomsDatasExcelVo> getCustomsDatasExcelList(OrderQueryDTO query) {
caseStatus(query.getStatus(),query); caseStatus(query.getStatus(), query);
return orderMapper.getCustomsDatasExcelList(query); return orderMapper.getCustomsDatasExcelList(query);
} }
...@@ -2046,7 +2072,7 @@ public class OrderQueryServiceImpl implements OrderQueryService { ...@@ -2046,7 +2072,7 @@ public class OrderQueryServiceImpl implements OrderQueryService {
*/ */
@Override @Override
public List<OrderShipDataExcelVo> getShipDatasExcelList(OrderQueryDTO query) { public List<OrderShipDataExcelVo> getShipDatasExcelList(OrderQueryDTO query) {
caseStatus(query.getStatus(),query); caseStatus(query.getStatus(), query);
return orderMapper.getShipDatasExcelList(query); return orderMapper.getShipDatasExcelList(query);
} }
...@@ -2058,7 +2084,7 @@ public class OrderQueryServiceImpl implements OrderQueryService { ...@@ -2058,7 +2084,7 @@ public class OrderQueryServiceImpl implements OrderQueryService {
*/ */
@Override @Override
public List<OrderShipFeeExcelVo> getShipFeeExcelList(OrderQueryDTO query) { public List<OrderShipFeeExcelVo> getShipFeeExcelList(OrderQueryDTO query) {
caseStatus(query.getStatus(),query); caseStatus(query.getStatus(), query);
return orderMapper.getShipFeeExcelList(query); return orderMapper.getShipFeeExcelList(query);
} }
......
...@@ -1743,7 +1743,8 @@ public class ProductPriceServiceImpl extends AbstractService<ProductPriceMapper, ...@@ -1743,7 +1743,8 @@ public class ProductPriceServiceImpl extends AbstractService<ProductPriceMapper,
List<Long> productIdList = list.stream() List<Long> productIdList = list.stream()
.map(ProductPriceBaseVO::getProductId) .map(ProductPriceBaseVO::getProductId)
.collect(Collectors.toList()); .collect(Collectors.toList());
List<ProductDO> productDOList = productService.getProductList(productIdList); List<ProductDO> productDOList =
productService.getProductList(productIdList);
Map<Long, ProductDO> productMap = productDOList.stream() Map<Long, ProductDO> productMap = productDOList.stream()
.collect(Collectors.toMap(ProductDO::getId, (v -> v), (v1, v2) -> v2)); .collect(Collectors.toMap(ProductDO::getId, (v -> v), (v1, v2) -> v2));
......
package cn.iocoder.yudao.module.shipment.dto;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.alibaba.excel.annotation.write.style.ContentRowHeight;
import com.alibaba.excel.converters.string.StringImageConverter;
import lombok.Data;
import java.io.File;
import java.io.InputStream;
import java.net.URL;
@Data
@ContentRowHeight(100)
@ColumnWidth(100 / 8)
public class ImageData {
private File file;
private InputStream inputStream;
/**
* 如果string类型 必须指定转换器,string默认转换成string
*/
@ExcelProperty(converter = StringImageConverter.class)
private String string;
private byte[] byteArray;
/**
* 根据url导出
*
* @since 2.1.1
*/
private URL url;
}
...@@ -52,11 +52,11 @@ import org.springframework.stereotype.Component; ...@@ -52,11 +52,11 @@ import org.springframework.stereotype.Component;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.io.File; import java.io.*;
import java.io.FileInputStream;
import java.io.InputStream;
import java.io.OutputStream;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.text.SimpleDateFormat;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter; import java.time.format.DateTimeFormatter;
import java.util.*; import java.util.*;
...@@ -99,8 +99,6 @@ public class ShipmentReceivableExcelExportListener { ...@@ -99,8 +99,6 @@ public class ShipmentReceivableExcelExportListener {
@Resource @Resource
private ReceivableService receivableService; private ReceivableService receivableService;
// @Value("${ue.templates-url}")
// private String path;
/** /**
* 订单导出监听 * 订单导出监听
...@@ -221,6 +219,8 @@ public class ShipmentReceivableExcelExportListener { ...@@ -221,6 +219,8 @@ public class ShipmentReceivableExcelExportListener {
totalJnSeaFreight = totalJnSeaFreight.add(jnyfyf); totalJnSeaFreight = totalJnSeaFreight.add(jnyfyf);
} }
headMap.put("totalNum", totalNum); headMap.put("totalNum", totalNum);
headMap.put("totalVolume", totalVolume.doubleValue()); headMap.put("totalVolume", totalVolume.doubleValue());
headMap.put("totalWeight", totalWeight.doubleValue()); headMap.put("totalWeight", totalWeight.doubleValue());
...@@ -269,4 +269,6 @@ public class ShipmentReceivableExcelExportListener { ...@@ -269,4 +269,6 @@ public class ShipmentReceivableExcelExportListener {
} }
} }
} }
...@@ -23,6 +23,7 @@ import cn.iocoder.yudao.module.order.service.order.*; ...@@ -23,6 +23,7 @@ import cn.iocoder.yudao.module.order.service.order.*;
import cn.iocoder.yudao.module.shipment.dal.dataobject.BoxDO; import cn.iocoder.yudao.module.shipment.dal.dataobject.BoxDO;
import cn.iocoder.yudao.module.shipment.dal.dataobject.BoxMergePkgDO; import cn.iocoder.yudao.module.shipment.dal.dataobject.BoxMergePkgDO;
import cn.iocoder.yudao.module.shipment.dal.dataobject.BoxPkgOrderDO; import cn.iocoder.yudao.module.shipment.dal.dataobject.BoxPkgOrderDO;
import cn.iocoder.yudao.module.shipment.dto.ImageData;
import cn.iocoder.yudao.module.shipment.service.box.BoxService; import cn.iocoder.yudao.module.shipment.service.box.BoxService;
import cn.iocoder.yudao.module.shipment.service.boxMergePkg.BoxMergePkgService; import cn.iocoder.yudao.module.shipment.service.boxMergePkg.BoxMergePkgService;
import cn.iocoder.yudao.module.shipment.service.boxPkgOrder.BoxPkgOrderService; import cn.iocoder.yudao.module.shipment.service.boxPkgOrder.BoxPkgOrderService;
...@@ -34,6 +35,7 @@ import cn.iocoder.yudao.module.wealth.service.receivable.ReceivableService; ...@@ -34,6 +35,7 @@ import cn.iocoder.yudao.module.wealth.service.receivable.ReceivableService;
import cn.iocoder.yudao.module.wealth.vo.receivable.ReceivableOrderPayedFeeTypeVO; import cn.iocoder.yudao.module.wealth.vo.receivable.ReceivableOrderPayedFeeTypeVO;
import com.alibaba.excel.EasyExcel; import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.ExcelWriter; import com.alibaba.excel.ExcelWriter;
import com.alibaba.excel.util.FileUtils;
import com.alibaba.excel.write.metadata.WriteSheet; import com.alibaba.excel.write.metadata.WriteSheet;
import com.alibaba.excel.write.metadata.fill.FillConfig; import com.alibaba.excel.write.metadata.fill.FillConfig;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
...@@ -45,6 +47,7 @@ import org.apache.poi.ss.usermodel.Workbook; ...@@ -45,6 +47,7 @@ import org.apache.poi.ss.usermodel.Workbook;
import org.apache.poi.ss.util.CellRangeAddress; import org.apache.poi.ss.util.CellRangeAddress;
import org.apache.poi.xssf.usermodel.XSSFWorkbook; import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.springframework.context.event.EventListener; import org.springframework.context.event.EventListener;
import org.springframework.security.config.annotation.web.configurers.UrlAuthorizationConfigurer;
import org.springframework.security.task.DelegatingSecurityContextAsyncTaskExecutor; import org.springframework.security.task.DelegatingSecurityContextAsyncTaskExecutor;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
...@@ -52,6 +55,9 @@ import javax.annotation.Resource; ...@@ -52,6 +55,9 @@ import javax.annotation.Resource;
import java.io.*; import java.io.*;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.math.RoundingMode; import java.math.RoundingMode;
import java.net.MalformedURLException;
import java.net.URL;
import java.text.SimpleDateFormat;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter; import java.time.format.DateTimeFormatter;
import java.util.*; import java.util.*;
...@@ -60,6 +66,8 @@ import java.util.stream.Collectors; ...@@ -60,6 +66,8 @@ import java.util.stream.Collectors;
import static cn.iocoder.yudao.framework.excel.constant.ExportConstant.DATA_FORMAT; import static cn.iocoder.yudao.framework.excel.constant.ExportConstant.DATA_FORMAT;
import static cn.iocoder.yudao.module.shipment.enums.ErrorCodeConstants.HAVE_NOT_PRELOAD_GOODS; import static cn.iocoder.yudao.module.shipment.enums.ErrorCodeConstants.HAVE_NOT_PRELOAD_GOODS;
import java.net.URL;
/** /**
* 自编号订单excel导出监听 * 自编号订单excel导出监听
* 海运应收汇总表单 * 海运应收汇总表单
...@@ -154,6 +162,9 @@ public class ShipmentReceivableExcelExportListener2 { ...@@ -154,6 +162,9 @@ public class ShipmentReceivableExcelExportListener2 {
getResourceAsStream(ueProperties.getTemplatesUrl() getResourceAsStream(ueProperties.getTemplatesUrl()
+ "/nrlyReceivable2.xlsx"); + "/nrlyReceivable2.xlsx");
String templateFileName=ueProperties.getTemplatesUrl()
+ "/nrlyReceivable2.xlsx";
BoxDO box = boxService.getBox(shipmentId); BoxDO box = boxService.getBox(shipmentId);
WarehouseDO startWarehouse = warehouseService.getWarehouse(box.getStartWarehouseId()); WarehouseDO startWarehouse = warehouseService.getWarehouse(box.getStartWarehouseId());
WarehouseDO destWarehouse = warehouseService.getWarehouse(box.getDestWarehouseId()); WarehouseDO destWarehouse = warehouseService.getWarehouse(box.getDestWarehouseId());
...@@ -191,6 +202,20 @@ public class ShipmentReceivableExcelExportListener2 { ...@@ -191,6 +202,20 @@ public class ShipmentReceivableExcelExportListener2 {
headMap.put("lkRight", warehouseLineDO.getLkRight()); headMap.put("lkRight", warehouseLineDO.getLkRight());
} }
//lanbm 2024-06-11 添加图片自动填充功能
ImageData imageData = new ImageData();
imageData.setUrl(new URL(
"https://jiedao-pre-production.oss-cn-shenzhen.aliyuncs.com/2024/06/11/6668347de4b001393be98e24.jpg"));
headMap.put("img1", imageData.getUrl());
headMap.put("img2", imageData.getUrl());
//end lanbm 2024-06-11 添加图片自动填充功能
if(box.getZgDate()!=null) {
//装柜日期 日期格式化
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
String currentDate = sdf.format(box.getZgDate());
headMap.put("zkDate", currentDate);
}
headMap.put("selfNo", box.getSelfNo()); headMap.put("selfNo", box.getSelfNo());
headMap.put("fromZh", senderInfo.getName()); headMap.put("fromZh", senderInfo.getName());
headMap.put("fromEn", senderInfo.getNameEn()); headMap.put("fromEn", senderInfo.getNameEn());
...@@ -458,6 +483,17 @@ public class ShipmentReceivableExcelExportListener2 { ...@@ -458,6 +483,17 @@ public class ShipmentReceivableExcelExportListener2 {
headMap.put("sum11", currencyFuhaoMap.get(qgCurrency) + sum11); headMap.put("sum11", currencyFuhaoMap.get(qgCurrency) + sum11);
headMap.put("sum12", currencyFuhaoMap.get(yfCurrency) + sum12); headMap.put("sum12", currencyFuhaoMap.get(yfCurrency) + sum12);
headMap.put("sum13", currencyFuhaoMap.get(qgCurrency) + sum13); headMap.put("sum13", currencyFuhaoMap.get(qgCurrency) + sum13);
//按模板中的逻辑计算出来的
headMap.put("DesAgentFee",
currencyFuhaoMap.get(yfCurrency) +
sum6.multiply(new BigDecimal(0.2)).
setScale(2, RoundingMode.HALF_UP));
headMap.put("BillinTTl",
currencyFuhaoMap.get(qgCurrency)
+sum6.subtract(sum4).subtract(
sum6.multiply(new BigDecimal(0.2)).setScale(2, RoundingMode.HALF_UP)));
int sumCount = 0; int sumCount = 0;
for (BoxMergePkgDO boxMergePkgDO : boxMergePkgDOS) { for (BoxMergePkgDO boxMergePkgDO : boxMergePkgDOS) {
Long count = boxPkgOrderService.selectCount(BoxPkgOrderDO::getPkgId, boxMergePkgDO.getId()); Long count = boxPkgOrderService.selectCount(BoxPkgOrderDO::getPkgId, boxMergePkgDO.getId());
...@@ -487,13 +523,13 @@ public class ShipmentReceivableExcelExportListener2 { ...@@ -487,13 +523,13 @@ public class ShipmentReceivableExcelExportListener2 {
WriteSheet sheet = EasyExcel.writerSheet(0).build(); WriteSheet sheet = EasyExcel.writerSheet(0).build();
FillConfig fillConfig = FillConfig.builder().forceNewRow(true).build(); FillConfig fillConfig = FillConfig.builder().forceNewRow(true).build();
excelWriter.fill(headMap, sheet);//填充非循环数据--表头 excelWriter.fill(headMap, sheet);//填充非循环数据--表头
excelWriter.fill(list, fillConfig, sheet);//填充循环数据--表数据 excelWriter.fill(list, fillConfig, sheet);//填充循环数据--表数据
excelWriter.finish(); excelWriter.finish();
inputStream.close(); inputStream.close();
// 获取到临时文件 // 获取到临时文件
File file = new File(dir + fileName); File file = new File(dir + fileName);
//TODO 利用POI 合并单元格 //TODO 利用POI 合并单元格
Workbook workbook = new XSSFWorkbook(file); Workbook workbook = new XSSFWorkbook(file);
Sheet poiSheet = workbook.getSheetAt(0); Sheet poiSheet = workbook.getSheetAt(0);
...@@ -544,10 +580,103 @@ public class ShipmentReceivableExcelExportListener2 { ...@@ -544,10 +580,103 @@ public class ShipmentReceivableExcelExportListener2 {
} else { } else {
event.setResult("param fail"); event.setResult("param fail");
} }
} }
private BigDecimal changeAmountToDestCurrency(Long fromCurrencyId, Long toCurrencyId, BigDecimal fromAmount) { /*
@EventListener(ShipmentReceivableExcelExportPushEvent2.class)
public void shipmentReceivableExcelExportPushEvent(
ShipmentReceivableExcelExportPushEvent2 event)
throws MalformedURLException {
String sPath = "D:\\temp";
String fileName2 = sPath + File.separator + "1.xlsx";
ImageData imageData2 = new ImageData();
imageData2.setUrl(new URL(
"https://jiedao-pre-production.oss-cn-shenzhen.aliyuncs.com/2024/06/11/6668347de4b001393be98e24.jpg"));
Map<String, Object> map = new HashMap<>();
map.put("img1", imageData2.getUrl());
String templateFileName2 = "D:\\jd\\jiedao-api-boot-master\\yudao-server\\src\\main\\resources\\templates\\nrlyReceivable2.xlsx";
EasyExcel.write(fileName2).
withTemplate(templateFileName2).
sheet().doFill(map);
return;
/*
if (StringUtils.isNotBlank(event.getRequestParams())) {
try {
DateTimeFormatter formatter = DateTimeFormatter.ofPattern(DATA_FORMAT);
String nowTime = formatter.format(LocalDateTime.now());
String dir = ueProperties.getTempDir().concat("/receivable/excel/");
//先不合并单元格,之后合并,把合并的传到服务器 lanbm 2024-05-25 add
String fileName = event.getUserId().toString().
concat(StrUtil.DASHED).concat(event.getUserType().toString()).
concat(StrUtil.DASHED).concat(nowTime).
concat("receivable_notMerge.xlsx");
String fileNameMerge = event.getUserId().toString().
concat(StrUtil.DASHED).concat(event.getUserType().toString()).
concat(StrUtil.DASHED).concat(nowTime).
concat("receivable_Merge.xlsx");
InputStream inputStream = null;
JSONObject jsonObject =
JSONObject.parseObject(event.getRequestParams());
Long shipmentId = jsonObject.getLong("shipmentId");
inputStream = getClass().getClassLoader().
getResourceAsStream(ueProperties.getTemplatesUrl()
+ "/nrlyReceivable2.xlsx");
String templateFileName = ueProperties.getTemplatesUrl()
+ "/nrlyReceivable2.xlsx";
Map headMap = new HashMap();
//lanbm 2024-06-11 添加图片自动填充功能
ImageData imageData = new ImageData();
imageData.setUrl(new URL(
"https://jiedao-pre-production.oss-cn-shenzhen.aliyuncs.com/2024/06/11/6668347de4b001393be98e24.jpg"));
headMap.put("img1", imageData.getUrl());
headMap.put("img2", imageData.getUrl());
//end lanbm 2024-06-11 添加图片自动填充功能
File fileDir = new File(dir);
if (!fileDir.exists()) {
// 不存在则创建一个目录
fileDir.mkdirs();
}
//ExcelWriter excelWriter =
// EasyExcel.write(dir + fileName).
// withTemplate(inputStream).build();
// WriteSheet sheet = EasyExcel.writerSheet(0).build();
// excelWriter.fill(headMap, sheet);//填充非循环数据--表头
// excelWriter.finish();
// inputStream.close();
EasyExcel.write(dir + fileName).
withTemplate(inputStream).
sheet().doFill(headMap);
} catch (Exception e) {
e.printStackTrace();
event.setResult(e.getMessage());
}
} else {
event.setResult("param fail");
}
*/
// }
private BigDecimal changeAmountToDestCurrency(Long fromCurrencyId,
Long toCurrencyId,
BigDecimal fromAmount) {
BigDecimal destAmount = BigDecimal.ZERO; BigDecimal destAmount = BigDecimal.ZERO;
ExchangeRateRespDTO currencyRate = currencyApi.getCurrencyRate(fromCurrencyId, toCurrencyId); ExchangeRateRespDTO currencyRate = currencyApi.getCurrencyRate(fromCurrencyId, toCurrencyId);
destAmount = fromAmount.multiply(currencyRate.getCurrencyRate()); destAmount = fromAmount.multiply(currencyRate.getCurrencyRate());
......
...@@ -116,7 +116,8 @@ public class BoxApprovalServiceImpl extends AbstractService<BoxApprovalMapper, B ...@@ -116,7 +116,8 @@ public class BoxApprovalServiceImpl extends AbstractService<BoxApprovalMapper, B
String flowKey = ""; String flowKey = "";
//----------------------------------------预装--------------------------------------- //----------------------------------------预装---------------------------------------
if (createReqVO.getApprovalType() == BoxApprovalTypeEnum.PRELOAD.getType()) { if (createReqVO.getApprovalType() ==
BoxApprovalTypeEnum.PRELOAD.getType()) {
//检查是否有预装订单 //检查是否有预装订单
boxService.checkPreInstallNum(shipmentId); boxService.checkPreInstallNum(shipmentId);
...@@ -134,7 +135,8 @@ public class BoxApprovalServiceImpl extends AbstractService<BoxApprovalMapper, B ...@@ -134,7 +135,8 @@ public class BoxApprovalServiceImpl extends AbstractService<BoxApprovalMapper, B
boxService.updateOrderStatusByShipmentId(shipmentId, null, 0, boxService.updateOrderStatusByShipmentId(shipmentId, null, 0,
BoxStatusEnum.PREINSTALL_EXAMINE.getStatus(), pre_install_processing.getType(), pre_install_processing.getDesc()); BoxStatusEnum.PREINSTALL_EXAMINE.getStatus(), pre_install_processing.getType(), pre_install_processing.getDesc());
} else if (createReqVO.getApprovalType() == BoxApprovalTypeEnum.SEALING_CABINET.getType()) { } else if (createReqVO.getApprovalType() ==
BoxApprovalTypeEnum.SEALING_CABINET.getType()) {
//首先校验出货是否已经预装审核成功 //首先校验出货是否已经预装审核成功
Integer prStatus = boxDO.getPrStatus(); Integer prStatus = boxDO.getPrStatus();
if(prStatus != PrStatusEnum.PRELOAD_APPROVAL_SUCCESS.getPrStatus()) { if(prStatus != PrStatusEnum.PRELOAD_APPROVAL_SUCCESS.getPrStatus()) {
...@@ -183,7 +185,8 @@ public class BoxApprovalServiceImpl extends AbstractService<BoxApprovalMapper, B ...@@ -183,7 +185,8 @@ public class BoxApprovalServiceImpl extends AbstractService<BoxApprovalMapper, B
boxOpLogService.createBoxOpLog(shipmentId, ulStatusEnum.getUlStatus(), ulStatusEnum.getStatusNameZh(), ulStatusEnum.getStatusNameEn(), boxApproval.getId()); boxOpLogService.createBoxOpLog(shipmentId, ulStatusEnum.getUlStatus(), ulStatusEnum.getStatusNameZh(), ulStatusEnum.getStatusNameEn(), boxApproval.getId());
} }
//-------------------------------------------预装反审---------------------------------------- //-------------------------------------------预装反审----------------------------------------
else if (createReqVO.getApprovalType() == BoxApprovalTypeEnum.PRELOAD_UMPIRE.getType()) { else if (createReqVO.getApprovalType() ==
BoxApprovalTypeEnum.PRELOAD_UMPIRE.getType()) {
//预装反审 //预装反审
flowKey = WorkFlowEmus.SHIPMENT_PREASSEMBLE_NO.getKey(); flowKey = WorkFlowEmus.SHIPMENT_PREASSEMBLE_NO.getKey();
...@@ -406,11 +409,13 @@ public class BoxApprovalServiceImpl extends AbstractService<BoxApprovalMapper, B ...@@ -406,11 +409,13 @@ public class BoxApprovalServiceImpl extends AbstractService<BoxApprovalMapper, B
boxService.addOrderLog(Collections.singletonList(orderId), orderShipmentLog, ""); boxService.addOrderLog(Collections.singletonList(orderId), orderShipmentLog, "");
} }
//-----------------------------------------批量加价------------------------------------------- //-----------------------------------------批量加价-------------------------------------------
else if(createReqVO.getApprovalType() == BoxApprovalTypeEnum.BATCH_ADD_PRICE.getType()) { else if(createReqVO.getApprovalType() ==
BoxApprovalTypeEnum.BATCH_ADD_PRICE.getType()) {
//批量加价 //批量加价
flowKey = WorkFlowEmus.SHIPMENT_BATCH_ADD_PRICE.getKey(); flowKey = WorkFlowEmus.SHIPMENT_BATCH_ADD_PRICE.getKey();
String details = createReqVO.getDetails(); String details = createReqVO.getDetails();
BoxOrderMarkUpVO boxOrderMarkUpVO = JSON.parseObject(details, BoxOrderMarkUpVO.class); BoxOrderMarkUpVO boxOrderMarkUpVO =
JSON.parseObject(details, BoxOrderMarkUpVO.class);
boxService.checkOrderPayStatus(boxOrderMarkUpVO.getOrderIds()); boxService.checkOrderPayStatus(boxOrderMarkUpVO.getOrderIds());
} }
//-----------------------------------------删单退场------------------------------------------- //-----------------------------------------删单退场-------------------------------------------
...@@ -547,7 +552,9 @@ public class BoxApprovalServiceImpl extends AbstractService<BoxApprovalMapper, B ...@@ -547,7 +552,9 @@ public class BoxApprovalServiceImpl extends AbstractService<BoxApprovalMapper, B
} }
Long userId = SecurityFrameworkUtils.getLoginUserId(); Long userId = SecurityFrameworkUtils.getLoginUserId();
String bpmProcessId = bpmCreateServiceFactory.createBmp(userId, boxApproval.getId(), flowKey, boxDO.getSelfNo(), createReqVO.getCopyUserId()); String bpmProcessId = bpmCreateServiceFactory.createBmp(userId,
boxApproval.getId(), flowKey, boxDO.getSelfNo(),
createReqVO.getCopyUserId());
boxApproval.setBpmProcessId(bpmProcessId); boxApproval.setBpmProcessId(bpmProcessId);
boxApprovalMapper.updateById(boxApproval); boxApprovalMapper.updateById(boxApproval);
// 返回 // 返回
......
...@@ -2,9 +2,11 @@ package cn.iocoder.yudao.module.shipment.service.boxLadingBill; ...@@ -2,9 +2,11 @@ package cn.iocoder.yudao.module.shipment.service.boxLadingBill;
import java.io.*; import java.io.*;
import java.util.*; import java.util.*;
import java.util.stream.Collectors;
import javax.annotation.Resource; import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.date.DateUtil; import cn.hutool.core.date.DateUtil;
import cn.iocoder.yudao.framework.common.exception.ServiceException; import cn.iocoder.yudao.framework.common.exception.ServiceException;
import cn.iocoder.yudao.framework.dict.core.dto.DictDataRespDTO; import cn.iocoder.yudao.framework.dict.core.dto.DictDataRespDTO;
...@@ -38,6 +40,8 @@ import cn.iocoder.yudao.module.shipment.service.boxShipping.BoxShippingService; ...@@ -38,6 +40,8 @@ import cn.iocoder.yudao.module.shipment.service.boxShipping.BoxShippingService;
import cn.iocoder.yudao.module.shipment.vo.boxLadingBill.BoxLadingBillCreateReqVO; import cn.iocoder.yudao.module.shipment.vo.boxLadingBill.BoxLadingBillCreateReqVO;
import cn.iocoder.yudao.module.shipment.vo.boxLadingBill.BoxLadingBillQueryVO; import cn.iocoder.yudao.module.shipment.vo.boxLadingBill.BoxLadingBillQueryVO;
import cn.iocoder.yudao.module.shipment.vo.boxLadingBill.BoxLadingBillUpdateReqVO; import cn.iocoder.yudao.module.shipment.vo.boxLadingBill.BoxLadingBillUpdateReqVO;
import cn.iocoder.yudao.module.system.api.dict.DictDataApi;
import cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO;
import com.alibaba.excel.EasyExcel; import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.ExcelWriter; import com.alibaba.excel.ExcelWriter;
import com.alibaba.excel.write.metadata.WriteSheet; import com.alibaba.excel.write.metadata.WriteSheet;
...@@ -47,6 +51,7 @@ import com.itextpdf.text.pdf.BaseFont; ...@@ -47,6 +51,7 @@ import com.itextpdf.text.pdf.BaseFont;
import com.itextpdf.text.pdf.PdfReader; import com.itextpdf.text.pdf.PdfReader;
import com.itextpdf.text.pdf.PdfStamper; import com.itextpdf.text.pdf.PdfStamper;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Lazy; import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -100,6 +105,12 @@ public class BoxLadingBillServiceImpl extends AbstractService<BoxLadingBillMappe ...@@ -100,6 +105,12 @@ public class BoxLadingBillServiceImpl extends AbstractService<BoxLadingBillMappe
@Lazy @Lazy
private BoxAgentService boxAgentService; private BoxAgentService boxAgentService;
/*
数据字典项
*/
@Autowired
private DictDataApi dictDataApi;
@Value("${ue.templates-url}") @Value("${ue.templates-url}")
private String path; private String path;
...@@ -167,6 +178,19 @@ public class BoxLadingBillServiceImpl extends AbstractService<BoxLadingBillMappe ...@@ -167,6 +178,19 @@ public class BoxLadingBillServiceImpl extends AbstractService<BoxLadingBillMappe
if (boxLadingBillDO == null) { if (boxLadingBillDO == null) {
throw exception(MAKE_BILL_OF_LADING_NOT_EXISTS); throw exception(MAKE_BILL_OF_LADING_NOT_EXISTS);
} }
//包装单位 lanbm 2024-06-11 add
List<DictDataRespDTO> listPack =
dictDataApi.getDictDatas("packaging_type");
Map<String, String> PackMap = null;
if (CollectionUtil.isNotEmpty(listPack)) {
PackMap = listPack.stream().collect(
Collectors.toMap((DictDataRespDTO::getValue),
DictDataRespDTO::getLabel));
}
//end 包装单位 lanbm 2024-06-11 add
BoxShippingDO boxShippingDO = BoxShippingDO boxShippingDO =
boxShippingService.getOne( boxShippingService.getOne(
new LambdaQueryWrapperX<BoxShippingDO>().eq(BoxShippingDO::getShipmentId, new LambdaQueryWrapperX<BoxShippingDO>().eq(BoxShippingDO::getShipmentId,
...@@ -261,10 +285,16 @@ public class BoxLadingBillServiceImpl extends AbstractService<BoxLadingBillMappe ...@@ -261,10 +285,16 @@ public class BoxLadingBillServiceImpl extends AbstractService<BoxLadingBillMappe
// } // }
// } // }
// headMap.put("description",boxLadingBillDO.getGoodsDesc()+"\r\n"+stringBuffer.toString()); // headMap.put("description",boxLadingBillDO.getGoodsDesc()+"\r\n"+stringBuffer.toString());
//lanbm 2024-06-06 添加保存数量和单位 //lanbm 2024-06-06 添加保存数量和单位
String sDes=boxLadingBillDO.getPackageNum()+boxLadingBillDO.getPackageUnit(); String sPackName = "";
sDes+="\r\n"+boxLadingBillDO.getGoodsDesc(); String sUnit = boxLadingBillDO.getPackageUnit();
headMap.put("description",sDes); if (CollectionUtil.isNotEmpty(PackMap) && sUnit != null && sUnit.length() > 0) {
sPackName = sPackName = PackMap.get(sUnit);
}
String sDes = boxLadingBillDO.getPackageNum() + sPackName;
sDes += "\r\n" + boxLadingBillDO.getGoodsDesc();
headMap.put("description", sDes);
//headMap.put("description", boxLadingBillDO.getGoodsDesc()); //headMap.put("description", boxLadingBillDO.getGoodsDesc());
//end lanbm 2024-06-06 添加保存数量和单位 //end lanbm 2024-06-06 添加保存数量和单位
......
...@@ -1860,7 +1860,8 @@ public class BoxPreloadGoodsServiceImpl extends AbstractService<BoxPreloadGoodsM ...@@ -1860,7 +1860,8 @@ public class BoxPreloadGoodsServiceImpl extends AbstractService<BoxPreloadGoodsM
@Override @Override
public BoxLoadDetailBackVO boxGoodsDetail(Long shipmentId, Long secId) { public BoxLoadDetailBackVO boxGoodsDetail(Long shipmentId, Long secId) {
BoxLoadDetailBackVO detailBackVO = boxGoodsList(shipmentId, secId, null, 0); BoxLoadDetailBackVO detailBackVO = boxGoodsList(shipmentId,
secId, null, 0);
//查询订单的报关费用 //查询订单的报关费用
List<BoxLoadOrderVO> orderVOList = detailBackVO.getSectionOrderList(); List<BoxLoadOrderVO> orderVOList = detailBackVO.getSectionOrderList();
......
...@@ -53,11 +53,15 @@ public class BoxApprovalController { ...@@ -53,11 +53,15 @@ public class BoxApprovalController {
@Resource @Resource
private OrderApprovalService orderApprovalService; private OrderApprovalService orderApprovalService;
/*
创建出货审批流程 lanbm 2024-06-11 添加注释
*/
@PostMapping("/create") @PostMapping("/create")
@ApiOperation("创建出货审核, use this") @ApiOperation("创建出货审核, use this")
@Idempotent(timeout = 10) @Idempotent(timeout = 10)
// //@PreAuthorize("@ss.hasPermission('ecw:box-approval:create')") //@PreAuthorize("@ss.hasPermission('ecw:box-approval:create')")
public CommonResult<Long> createBoxApproval(@Valid @RequestBody BoxApprovalCreateReqVO createReqVO) { public CommonResult<Long> createBoxApproval(
@Valid @RequestBody BoxApprovalCreateReqVO createReqVO) {
return success(boxApprovalService.createBoxApproval(createReqVO)); return success(boxApprovalService.createBoxApproval(createReqVO));
} }
......
...@@ -31,7 +31,6 @@ public class BoxOpLogController { ...@@ -31,7 +31,6 @@ public class BoxOpLogController {
@Resource @Resource
private BoxOpLogService boxOpLogService; private BoxOpLogService boxOpLogService;
@GetMapping("/get") @GetMapping("/get")
@ApiOperation("获得出货操作日志") @ApiOperation("获得出货操作日志")
@ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class) @ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class)
...@@ -41,9 +40,12 @@ public class BoxOpLogController { ...@@ -41,9 +40,12 @@ public class BoxOpLogController {
return success(BoxOpLogConvert.INSTANCE.convert(boxOpLog)); return success(BoxOpLogConvert.INSTANCE.convert(boxOpLog));
} }
/*
获取订单的操作日志 lanbm 2024-06-11 添加注释
*/
@GetMapping("/list") @GetMapping("/list")
@ApiOperation("获得出货操作日志列表, use this") @ApiOperation("获得出货操作日志列表, use this")
// @PreAuthorize("@ss.hasPermission('ecw:box-op-log:query')") //@PreAuthorize("@ss.hasPermission('ecw:box-op-log:query')")
public CommonResult<List<BoxOpLogBackVO>> getBoxOpLogList(BoxOpLogQueryVO query) { public CommonResult<List<BoxOpLogBackVO>> getBoxOpLogList(BoxOpLogQueryVO query) {
List<BoxOpLogDO> list = boxOpLogService.getBoxOpLogList(query); List<BoxOpLogDO> list = boxOpLogService.getBoxOpLogList(query);
List<BoxOpLogBackVO> resultList = BoxOpLogConvert.INSTANCE.convertList(list); List<BoxOpLogBackVO> resultList = BoxOpLogConvert.INSTANCE.convertList(list);
......
...@@ -462,7 +462,8 @@ public class BoxPreloadGoodsController { ...@@ -462,7 +462,8 @@ public class BoxPreloadGoodsController {
@ApiImplicitParam(name = "secId", value = "部分ID", required = false, example = "20", dataTypeClass = Long.class) @ApiImplicitParam(name = "secId", value = "部分ID", required = false, example = "20", dataTypeClass = Long.class)
}) })
public CommonResult<BoxLoadDetailBackVO> boxGoodsDetail(@RequestParam("shipmentId") Long shipmentId, @RequestParam("secId") Long secId) { public CommonResult<BoxLoadDetailBackVO> boxGoodsDetail(@RequestParam("shipmentId") Long shipmentId, @RequestParam("secId") Long secId) {
BoxLoadDetailBackVO boxLoadDetailBackVO = boxPreloadGoodsService.boxGoodsDetail(shipmentId, secId); BoxLoadDetailBackVO boxLoadDetailBackVO =
boxPreloadGoodsService.boxGoodsDetail(shipmentId, secId);
return success(boxLoadDetailBackVO); return success(boxLoadDetailBackVO);
} }
......
...@@ -450,39 +450,40 @@ public class ReceiptServiceImpl extends AbstractService<ReceiptMapper, ReceiptDO ...@@ -450,39 +450,40 @@ public class ReceiptServiceImpl extends AbstractService<ReceiptMapper, ReceiptDO
List<Long> idList = mpPage.getRecords().stream() List<Long> idList = mpPage.getRecords().stream()
.map(ReceiptBackVO::getId) .map(ReceiptBackVO::getId)
.collect(Collectors.toList()); .collect(Collectors.toList());
//根据List获取本页中所有的明细信息 //一定要判空,不然会报错
LambdaQueryWrapper<ReceiptItemDO> lambdaQueryWrapper = if(CollectionUtil.isNotEmpty(idList)) {
new LambdaQueryWrapper<>(); //根据List获取本页中所有的明细信息
lambdaQueryWrapper.in(ReceiptItemDO::getReceiptId, idList); LambdaQueryWrapper<ReceiptItemDO> lambdaQueryWrapper =
new LambdaQueryWrapper<>();
//所有收款单的明细 lambdaQueryWrapper.in(ReceiptItemDO::getReceiptId, idList);
List<ReceiptItemDO> listItem = //所有收款单的明细
receiptItemMapper.selectList(lambdaQueryWrapper); List<ReceiptItemDO> listItem =
receiptItemMapper.selectList(lambdaQueryWrapper);
LambdaQueryWrapper<ReceiptAccountDO> lambdaQueryWrapper2 = LambdaQueryWrapper<ReceiptAccountDO> lambdaQueryWrapper2 =
new LambdaQueryWrapper<>(); new LambdaQueryWrapper<>();
lambdaQueryWrapper2.in(ReceiptAccountDO::getReceiptId, idList); lambdaQueryWrapper2.in(ReceiptAccountDO::getReceiptId, idList);
List<ReceiptAccountDO> ReceiptAccountList = List<ReceiptAccountDO> ReceiptAccountList =
receiptAccountMapper.selectList(lambdaQueryWrapper2); receiptAccountMapper.selectList(lambdaQueryWrapper2);
Map<Integer, CurrencyRespDTO> currencyMap = currencyApi.getAllCurrency(); Map<Integer, CurrencyRespDTO> currencyMap = currencyApi.getAllCurrency();
for (ReceiptBackVO r : mpPage.getRecords() for (ReceiptBackVO r : mpPage.getRecords()
) { ) {
String sR = getReceiptMxStatus(listItem, r.getId()); String sR = getReceiptMxStatus(listItem, r.getId());
r.setMxStatus(sR); r.setMxStatus(sR);
//应收 //应收
String s1 = getYSShow(ReceiptAccountList, r.getId(), currencyMap); String s1 = getYSShow(ReceiptAccountList, r.getId(), currencyMap);
r.setYsShow(s1); r.setYsShow(s1);
//实收 //实收
String s2 = getSSShow(listItem, r.getId(), currencyMap); String s2 = getSSShow(listItem, r.getId(), currencyMap);
r.setSsShow(s2); r.setSsShow(s2);
//核销比例 //核销比例
r.setHxBiLi(getHxBili(ReceiptAccountList, r.setHxBiLi(getHxBili(ReceiptAccountList,
listItem, r.getId())); listItem, r.getId()));
}
} }
return PageResult.of(mpPage); return PageResult.of(mpPage);
} }
......
...@@ -54,11 +54,19 @@ public class ReceiptItemBackVO { ...@@ -54,11 +54,19 @@ public class ReceiptItemBackVO {
@ApiModelProperty(value = "货币id") @ApiModelProperty(value = "货币id")
private Long currencyId; private Long currencyId;
@ExcelProperty("创建时间") @ExcelProperty("创建时间")
@JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY) @JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY)
@ApiModelProperty(value = "创建时间") @ApiModelProperty(value = "创建时间")
private Date createTime; private Date createTime;
/*
创建人
*/
private String creator;
@ExcelProperty("收款汇率") @ExcelProperty("收款汇率")
@ApiModelProperty(value = "收款汇率") @ApiModelProperty(value = "收款汇率")
private String rate; private String rate;
...@@ -99,4 +107,28 @@ public class ReceiptItemBackVO { ...@@ -99,4 +107,28 @@ public class ReceiptItemBackVO {
private String syValue; private String syValue;
/*
提交审批时间 lanbm 2024-06-07
*/
@JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY)
private Date createTimeBpm;
/*
提交审批人
*/
private String createBpm;
/*
审批通过时间 lanbm 2024-06-07
*/
@JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY)
private Date updateTimeBpm;
@JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY)
private Date updateTime;
private String updater;
} }
package cn.iocoder.yudao.module.wealth.vo.receiptItem; package cn.iocoder.yudao.module.wealth.vo.receiptItem;
import cn.iocoder.yudao.framework.common.pojo.PageParam; import cn.iocoder.yudao.framework.common.pojo.PageParam;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import lombok.Data; import lombok.Data;
import java.util.Date;
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY;
/* /*
lanbm 2024-05-18 add lanbm 2024-05-18 add
*/ */
...@@ -59,4 +64,16 @@ public class ReceiptItemReq extends PageParam { ...@@ -59,4 +64,16 @@ public class ReceiptItemReq extends PageParam {
*/ */
private String creator; private String creator;
@JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY)
private Date createTime;
private String updater;
@JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY)
private Date updateTime;
/*
收款账户
*/
private String accountNo;
} }
...@@ -129,6 +129,11 @@ public class ReceiptItemResp { ...@@ -129,6 +129,11 @@ public class ReceiptItemResp {
@ApiModelProperty(value = "创建时间") @ApiModelProperty(value = "创建时间")
private Date createTime; private Date createTime;
/*
提交审批人
*/
private String createBpm;
/* /*
提交审批时间 lanbm 2024-06-07 提交审批时间 lanbm 2024-06-07
*/ */
...@@ -142,5 +147,4 @@ public class ReceiptItemResp { ...@@ -142,5 +147,4 @@ public class ReceiptItemResp {
private Date updateTimeBpm; private Date updateTimeBpm;
} }
...@@ -7,10 +7,14 @@ import cn.iocoder.yudao.framework.common.util.io.FileModel; ...@@ -7,10 +7,14 @@ import cn.iocoder.yudao.framework.common.util.io.FileModel;
import cn.iocoder.yudao.framework.idempotent.core.annotation.Idempotent; import cn.iocoder.yudao.framework.idempotent.core.annotation.Idempotent;
import cn.iocoder.yudao.module.ecw.api.currency.CurrencyApi; import cn.iocoder.yudao.module.ecw.api.currency.CurrencyApi;
import cn.iocoder.yudao.module.ecw.api.currency.dto.CurrencyRespDTO; import cn.iocoder.yudao.module.ecw.api.currency.dto.CurrencyRespDTO;
import cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO;
import cn.iocoder.yudao.module.system.service.user.AdminUserService;
import cn.iocoder.yudao.module.wealth.convert.receiptItem.ReceiptItemConvert; import cn.iocoder.yudao.module.wealth.convert.receiptItem.ReceiptItemConvert;
import cn.iocoder.yudao.module.wealth.dal.dataobject.receiptAccount.ReceiptAccountDO; import cn.iocoder.yudao.module.wealth.dal.dataobject.receiptAccount.ReceiptAccountDO;
import cn.iocoder.yudao.module.wealth.dal.dataobject.receiptApproval.ReceiptApprovalDO;
import cn.iocoder.yudao.module.wealth.dal.dataobject.receiptItem.ReceiptItemDO; import cn.iocoder.yudao.module.wealth.dal.dataobject.receiptItem.ReceiptItemDO;
import cn.iocoder.yudao.module.wealth.dal.mysql.receiptAccount.ReceiptAccountMapper; import cn.iocoder.yudao.module.wealth.dal.mysql.receiptAccount.ReceiptAccountMapper;
import cn.iocoder.yudao.module.wealth.dal.mysql.receiptApproval.ReceiptApprovalMapper;
import cn.iocoder.yudao.module.wealth.dal.mysql.receiptItem.ReceiptItemMapper; import cn.iocoder.yudao.module.wealth.dal.mysql.receiptItem.ReceiptItemMapper;
import cn.iocoder.yudao.module.wealth.service.receiptItem.ReceiptItemService; import cn.iocoder.yudao.module.wealth.service.receiptItem.ReceiptItemService;
import cn.iocoder.yudao.module.wealth.vo.receipt.FinanceReceiptItemCancelVo; import cn.iocoder.yudao.module.wealth.vo.receipt.FinanceReceiptItemCancelVo;
...@@ -22,6 +26,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; ...@@ -22,6 +26,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
...@@ -47,17 +52,25 @@ public class ReceiptItemController { ...@@ -47,17 +52,25 @@ public class ReceiptItemController {
@Resource @Resource
private ReceiptAccountMapper receiptAccountMapper; private ReceiptAccountMapper receiptAccountMapper;
@Resource @Resource
private ReceiptItemMapper receiptItemMapper; private ReceiptItemMapper receiptItemMapper;
/* /*
币种 lanbm 2024-06-10 add 币种 lanbm 2024-06-10 add
*/ */
@Resource @Resource
CurrencyApi currencyApi; CurrencyApi currencyApi;
/*
lanbm 2024-05-17 add
*/
@Autowired
private AdminUserService adminUserService;
//审批信息
@Resource
private ReceiptApprovalMapper receiptApprovalMapper;
@PostMapping("/create") @PostMapping("/create")
@ApiOperation("创建收款明细") @ApiOperation("创建收款明细")
//@PreAuthorize("@ss.hasPermission('ecw:receipt-item:create')") //@PreAuthorize("@ss.hasPermission('ecw:receipt-item:create')")
...@@ -92,9 +105,57 @@ public class ReceiptItemController { ...@@ -92,9 +105,57 @@ public class ReceiptItemController {
//BigDecimal p = receiptItemService.getWriteOffAmountByReceiptId(id); //BigDecimal p = receiptItemService.getWriteOffAmountByReceiptId(id);
//BigDecimal t = receiptAccountMapper.getWriteOffAmountByReceiptId(id); //BigDecimal t = receiptAccountMapper.getWriteOffAmountByReceiptId(id);
getSY(v, v.getReceiptId()); getSY(v, v.getReceiptId());
SetData(v);
return success(v); return success(v);
} }
private void SetData(ReceiptItemBackVO v) {
List<AdminUserDO> ListUser = adminUserService.getUsersList();
Map<Long, String> userMap =
ListUser.stream().collect(
Collectors.toMap((AdminUserDO::getId),
AdminUserDO::getNickname));
String sT = "";
if (v.getCreator() != null) {
sT = userMap.get(Long.parseLong(v.getCreator()));
v.setCreator(sT);
}
if (v.getUpdater() != null && v.getUpdater().length() > 0) {
sT = userMap.get(Long.parseLong(v.getUpdater()));
v.setUpdater(sT);
}
if (v.getBmpId() == null||v.getBmpId().length()==0) {
v.setCreateBpm("");
v.setCreateTimeBpm(null);
v.setUpdateTimeBpm(null);
return;
}
LambdaQueryWrapper<ReceiptApprovalDO> lambdaQueryWrapper =
new LambdaQueryWrapper<>();
lambdaQueryWrapper.eq(ReceiptApprovalDO::getBmpId, v.getBmpId());
List<ReceiptApprovalDO> list =
receiptApprovalMapper.selectList(lambdaQueryWrapper);
if (list==null||list.size() == 0) return;
//审批创建人
if (list.get(0).getCreator() != null
&& list.get(0).getCreator().length() > 0) {
sT = userMap.get(Long.parseLong(list.get(0).getCreator()));
v.setCreateBpm(sT);
//审批创建日期
if (list.get(0).getCreateTime() != null)
v.setCreateTimeBpm(list.get(0).getCreateTime());
//审批通过日期
if (list.get(0).getUpdateTime() != null)
v.setUpdateTimeBpm(list.get(0).getUpdateTime());
}
}
/* /*
获取剩余金额 lanbm 2024-06-10 add 获取剩余金额 lanbm 2024-06-10 add
*/ */
...@@ -138,7 +199,7 @@ public class ReceiptItemController { ...@@ -138,7 +199,7 @@ public class ReceiptItemController {
bResult = t.subtract(p); bResult = t.subtract(p);
String bzName = ""; String bzName = "";
if (currencyId != null) { if (currencyId != null) {
int iId=Integer.parseInt(currencyId.toString()); int iId = Integer.parseInt(currencyId.toString());
bzName = currencyMap.get(iId).getTitleZh(); bzName = currencyMap.get(iId).getTitleZh();
} }
v.setSyValue(bResult.toString() + bzName); v.setSyValue(bResult.toString() + bzName);
...@@ -192,7 +253,8 @@ public class ReceiptItemController { ...@@ -192,7 +253,8 @@ public class ReceiptItemController {
@PostMapping("/cancelFinanceReceiptItemWriteOff") @PostMapping("/cancelFinanceReceiptItemWriteOff")
@ApiOperation("取消收款明细核销") @ApiOperation("取消收款明细核销")
@Idempotent(timeout = 5) @Idempotent(timeout = 5)
public CommonResult<Boolean> cancelFinanceReceiptItemWriteOff(@RequestBody FinanceReceiptItemCancelVo financeReceiptVo) { public CommonResult<Boolean> cancelFinanceReceiptItemWriteOff(@RequestBody FinanceReceiptItemCancelVo
financeReceiptVo) {
receiptItemService.cancelFinanceReceiptItemWriteOff(financeReceiptVo); receiptItemService.cancelFinanceReceiptItemWriteOff(financeReceiptVo);
return success(true); return success(true);
} }
...@@ -213,7 +275,8 @@ public class ReceiptItemController { ...@@ -213,7 +275,8 @@ public class ReceiptItemController {
@PostMapping("/cancelFinanceReceiptItemWriteOffNo") @PostMapping("/cancelFinanceReceiptItemWriteOffNo")
@ApiOperation("取消收款明细反核销") @ApiOperation("取消收款明细反核销")
@Idempotent(timeout = 5) @Idempotent(timeout = 5)
public CommonResult<Boolean> cancelFinanceReceiptItemWriteOffNo(@RequestBody FinanceReceiptItemCancelVo financeReceiptVo) { public CommonResult<Boolean> cancelFinanceReceiptItemWriteOffNo(@RequestBody FinanceReceiptItemCancelVo
financeReceiptVo) {
receiptItemService.cancelFinanceReceiptItemWriteOffNo(financeReceiptVo); receiptItemService.cancelFinanceReceiptItemWriteOffNo(financeReceiptVo);
return success(true); return success(true);
} }
......
...@@ -6,17 +6,20 @@ ...@@ -6,17 +6,20 @@
resultType="cn.iocoder.yudao.module.wealth.vo.receiptItem.ReceiptItemResp"> resultType="cn.iocoder.yudao.module.wealth.vo.receiptItem.ReceiptItemResp">
SELECT p.*,m.receipt_no,m.order_id, SELECT p.*,m.receipt_no,m.order_id,
r.order_no,r.tidan_no,a.create_time as create_time_bpm, r.order_no,r.tidan_no,a.create_time as create_time_bpm,
a.update_time as update_time_bpm a.update_time as update_time_bpm,a.creator as createBpm
from ecw_receipt_item p from ecw_receipt_item p
left join ecw_receipt m on p.receipt_id=m.id and m.deleted=0 left join ecw_receipt m on p.receipt_id=m.id and m.deleted=0
left join ecw_order r on r.order_id=m.order_id and r.deleted=0 left join ecw_order r on r.order_id=m.order_id and r.deleted=0
left join ecw_receipt_approval a on a.bmp_id=m.bmp_id and a.deleted=0 left join ecw_receipt_approval a on a.bmp_id=p.bmp_id and a.deleted=0
<include refid="WherePage"/> <include refid="WherePage"/>
ORDER BY m.receipt_no desc,p.create_time asc limit #{start}, #{pageSize} ORDER BY m.receipt_no desc,p.create_time asc limit #{start}, #{pageSize}
</select> </select>
<sql id="WherePage"> <sql id="WherePage">
<where> <where>
p.deleted=0 p.deleted=0
<if test="accountNo != null and accountNo != ''">
AND p.account_no=#{accountNo}
</if>
<if test="receiptNo != null and receiptNo != ''"> <if test="receiptNo != null and receiptNo != ''">
AND m.receipt_no like concat('%',#{receiptNo},'%') AND m.receipt_no like concat('%',#{receiptNo},'%')
</if> </if>
......
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