Showing
9 changed files
with
260 additions
and
50 deletions
| @@ -25,11 +25,13 @@ import com.lframework.xingyun.sc.service.paytype.OrderPayTypeService; | @@ -25,11 +25,13 @@ import com.lframework.xingyun.sc.service.paytype.OrderPayTypeService; | ||
| 25 | import com.lframework.xingyun.sc.service.purchase.PurchaseOrderService; | 25 | import com.lframework.xingyun.sc.service.purchase.PurchaseOrderService; |
| 26 | import com.lframework.xingyun.sc.service.purchase.ReceiveSheetService; | 26 | import com.lframework.xingyun.sc.service.purchase.ReceiveSheetService; |
| 27 | import com.lframework.xingyun.sc.service.shipments.ShipmentsPlanDetailService; | 27 | import com.lframework.xingyun.sc.service.shipments.ShipmentsPlanDetailService; |
| 28 | +import com.lframework.xingyun.sc.service.statistics.ShipmentDetailStatisticsService; | ||
| 28 | import com.lframework.xingyun.sc.service.stock.adjust.StockAdjustReasonService; | 29 | import com.lframework.xingyun.sc.service.stock.adjust.StockAdjustReasonService; |
| 29 | import com.lframework.xingyun.sc.service.stock.take.PreTakeStockSheetService; | 30 | import com.lframework.xingyun.sc.service.stock.take.PreTakeStockSheetService; |
| 30 | import com.lframework.xingyun.sc.service.stock.take.TakeStockPlanService; | 31 | import com.lframework.xingyun.sc.service.stock.take.TakeStockPlanService; |
| 31 | import com.lframework.xingyun.sc.vo.purchase.PurchaseOrderSelectorVo; | 32 | import com.lframework.xingyun.sc.vo.purchase.PurchaseOrderSelectorVo; |
| 32 | import com.lframework.xingyun.sc.vo.purchase.receive.ReceiveSheetSelectorVo; | 33 | import com.lframework.xingyun.sc.vo.purchase.receive.ReceiveSheetSelectorVo; |
| 34 | +import com.lframework.xingyun.sc.vo.statistics.shipmentDetail.QueryShipmentDetailStatisticsVo; | ||
| 33 | import com.lframework.xingyun.sc.vo.stock.adjust.stock.reason.StockAdjustReasonSelectorVo; | 35 | import com.lframework.xingyun.sc.vo.stock.adjust.stock.reason.StockAdjustReasonSelectorVo; |
| 34 | import com.lframework.xingyun.sc.vo.stock.take.plan.TakeStockPlanSelectorVo; | 36 | import com.lframework.xingyun.sc.vo.stock.take.plan.TakeStockPlanSelectorVo; |
| 35 | import com.lframework.xingyun.sc.vo.stock.take.pre.PreTakeStockSheetSelectorVo; | 37 | import com.lframework.xingyun.sc.vo.stock.take.pre.PreTakeStockSheetSelectorVo; |
| @@ -91,6 +93,8 @@ public class ScSelectorController extends DefaultBaseController { | @@ -91,6 +93,8 @@ public class ScSelectorController extends DefaultBaseController { | ||
| 91 | private SysDeptService sysDeptService; | 93 | private SysDeptService sysDeptService; |
| 92 | @Resource | 94 | @Resource |
| 93 | private ShipmentsPlanDetailService shipmentsPlanDetailService; | 95 | private ShipmentsPlanDetailService shipmentsPlanDetailService; |
| 96 | + @Resource | ||
| 97 | + private ShipmentDetailStatisticsService shipmentDetailStatisticsService; | ||
| 94 | 98 | ||
| 95 | 99 | ||
| 96 | /** | 100 | /** |
| @@ -448,4 +452,16 @@ public class ScSelectorController extends DefaultBaseController { | @@ -448,4 +452,16 @@ public class ScSelectorController extends DefaultBaseController { | ||
| 448 | } | 452 | } |
| 449 | } | 453 | } |
| 450 | } | 454 | } |
| 455 | + | ||
| 456 | + | ||
| 457 | + /** | ||
| 458 | + * 根据ID加载发货明细数据 | ||
| 459 | + */ | ||
| 460 | + @ApiOperation("根据ID加载发货明细数据") | ||
| 461 | + @PostMapping("/shipmentDetail/load") | ||
| 462 | + public InvokeResult<List<ShipmentDetailStatistics>> loadShipmentDetail(@RequestBody(required = false) List<String> ids) { | ||
| 463 | + QueryShipmentDetailStatisticsVo vo = new QueryShipmentDetailStatisticsVo(); | ||
| 464 | + vo.setIds(ids); | ||
| 465 | + return InvokeResultBuilder.success(shipmentDetailStatisticsService.queryShipmentDetail(vo)); | ||
| 466 | + } | ||
| 451 | } | 467 | } |
| @@ -83,12 +83,12 @@ public class ShipmentDetailStatisticsController extends DefaultBaseController { | @@ -83,12 +83,12 @@ public class ShipmentDetailStatisticsController extends DefaultBaseController { | ||
| 83 | } | 83 | } |
| 84 | 84 | ||
| 85 | /** | 85 | /** |
| 86 | - * 根据发货单ID获取发货明细数据 | 86 | + * 查询发货明细数据 |
| 87 | */ | 87 | */ |
| 88 | - @ApiOperation("根据发货单ID获取发货明细数据") | ||
| 89 | - @HasPermission({"statistics:shipmentDetail:modify"}) | ||
| 90 | - @GetMapping("/getByShipmentOrderId") | ||
| 91 | - public InvokeResult<List<ShipmentDetailStatistics>> getByShipmentOrderId(@NotBlank(message = "id不能为空!") String shipmentOrderId) { | ||
| 92 | - return InvokeResultBuilder.success(shipmentDetailStatisticsService.getShipmentDetailInfo(shipmentOrderId)); | 88 | + @ApiOperation("查询发货明细数据") |
| 89 | + @HasPermission({"statistics:shipmentDetail:add"}) | ||
| 90 | + @GetMapping("/queryShipmentDetail") | ||
| 91 | + public InvokeResult<PageResult<ShipmentDetailStatistics>> queryShipmentDetail(QueryShipmentDetailStatisticsVo vo) { | ||
| 92 | + return InvokeResultBuilder.success(shipmentDetailStatisticsService.pageShipmentDetail(getPageIndex(vo), getPageSize(vo), vo)); | ||
| 93 | } | 93 | } |
| 94 | } | 94 | } |
| @@ -35,6 +35,12 @@ public class ShipmentDetailStatistics extends BaseEntity implements BaseDto { | @@ -35,6 +35,12 @@ public class ShipmentDetailStatistics extends BaseEntity implements BaseDto { | ||
| 35 | private String shipmentOrderNo; | 35 | private String shipmentOrderNo; |
| 36 | 36 | ||
| 37 | /** | 37 | /** |
| 38 | + * 生产厂ID | ||
| 39 | + */ | ||
| 40 | + @TableField(exist = false) | ||
| 41 | + private String workshopId; | ||
| 42 | + | ||
| 43 | + /** | ||
| 38 | * 生产厂 | 44 | * 生产厂 |
| 39 | */ | 45 | */ |
| 40 | private String workshopName; | 46 | private String workshopName; |
| @@ -73,6 +79,18 @@ public class ShipmentDetailStatistics extends BaseEntity implements BaseDto { | @@ -73,6 +79,18 @@ public class ShipmentDetailStatistics extends BaseEntity implements BaseDto { | ||
| 73 | private String orderingUnitName; | 79 | private String orderingUnitName; |
| 74 | 80 | ||
| 75 | /** | 81 | /** |
| 82 | + * 合同ID | ||
| 83 | + */ | ||
| 84 | + @TableField(exist = false) | ||
| 85 | + private String contractId; | ||
| 86 | + | ||
| 87 | + /** | ||
| 88 | + * 合同类型 | ||
| 89 | + */ | ||
| 90 | + @TableField(exist = false) | ||
| 91 | + private String contractType; | ||
| 92 | + | ||
| 93 | + /** | ||
| 76 | * 牌号 | 94 | * 牌号 |
| 77 | */ | 95 | */ |
| 78 | private String brand; | 96 | private String brand; |
| @@ -214,6 +232,18 @@ public class ShipmentDetailStatistics extends BaseEntity implements BaseDto { | @@ -214,6 +232,18 @@ public class ShipmentDetailStatistics extends BaseEntity implements BaseDto { | ||
| 214 | private String settlementTerms; | 232 | private String settlementTerms; |
| 215 | 233 | ||
| 216 | /** | 234 | /** |
| 235 | + * 原材料与产品数量比 | ||
| 236 | + */ | ||
| 237 | + @TableField(exist = false) | ||
| 238 | + private String materialProductRatio; | ||
| 239 | + | ||
| 240 | + /** | ||
| 241 | + * 原材料与产品数量比备注 | ||
| 242 | + */ | ||
| 243 | + @TableField(exist = false) | ||
| 244 | + private String materialProductRatioRemarks; | ||
| 245 | + | ||
| 246 | + /** | ||
| 217 | * 加工、经销 | 247 | * 加工、经销 |
| 218 | */ | 248 | */ |
| 219 | private String processingOrDistribution; | 249 | private String processingOrDistribution; |
| @@ -3,10 +3,17 @@ package com.lframework.xingyun.sc.impl.statistics; | @@ -3,10 +3,17 @@ package com.lframework.xingyun.sc.impl.statistics; | ||
| 3 | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; | 3 | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| 4 | import com.baomidou.mybatisplus.core.toolkit.Wrappers; | 4 | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| 5 | import com.github.pagehelper.PageInfo; | 5 | import com.github.pagehelper.PageInfo; |
| 6 | +import com.lframework.starter.web.inner.entity.SysDataDicItem; | ||
| 6 | import com.lframework.starter.web.inner.entity.SysDept; | 7 | import com.lframework.starter.web.inner.entity.SysDept; |
| 8 | +import com.lframework.starter.web.inner.service.system.SysDataDicItemService; | ||
| 7 | import com.lframework.starter.web.inner.service.system.SysDeptService; | 9 | import com.lframework.starter.web.inner.service.system.SysDeptService; |
| 8 | import com.lframework.xingyun.basedata.entity.Customer; | 10 | import com.lframework.xingyun.basedata.entity.Customer; |
| 11 | +import com.lframework.xingyun.basedata.entity.CustomerShort; | ||
| 12 | +import com.lframework.xingyun.basedata.entity.Workshop; | ||
| 9 | import com.lframework.xingyun.basedata.service.customer.CustomerService; | 13 | import com.lframework.xingyun.basedata.service.customer.CustomerService; |
| 14 | +import com.lframework.xingyun.basedata.service.customer.CustomerShortService; | ||
| 15 | +import com.lframework.xingyun.basedata.service.workshop.WorkshopService; | ||
| 16 | +import com.lframework.xingyun.sc.entity.CustomerCredit; | ||
| 10 | import com.lframework.xingyun.sc.entity.ShipmentDetailStatistics; | 17 | import com.lframework.xingyun.sc.entity.ShipmentDetailStatistics; |
| 11 | import com.lframework.starter.web.core.impl.BaseMpServiceImpl; | 18 | import com.lframework.starter.web.core.impl.BaseMpServiceImpl; |
| 12 | import com.lframework.starter.web.core.utils.PageResultUtil; | 19 | import com.lframework.starter.web.core.utils.PageResultUtil; |
| @@ -20,6 +27,8 @@ import com.lframework.starter.web.core.utils.PageHelperUtil; | @@ -20,6 +27,8 @@ import com.lframework.starter.web.core.utils.PageHelperUtil; | ||
| 20 | import com.lframework.starter.common.utils.Assert; | 27 | import com.lframework.starter.common.utils.Assert; |
| 21 | import com.lframework.starter.web.inner.components.oplog.OtherOpLogType; | 28 | import com.lframework.starter.web.inner.components.oplog.OtherOpLogType; |
| 22 | import com.lframework.xingyun.sc.mappers.ShipmentDetailStatisticsMapper; | 29 | import com.lframework.xingyun.sc.mappers.ShipmentDetailStatisticsMapper; |
| 30 | +import com.lframework.xingyun.sc.service.contract.ContractStdProcessingLineService; | ||
| 31 | +import com.lframework.xingyun.sc.service.customer.CustomerCreditService; | ||
| 23 | import com.lframework.xingyun.sc.service.statistics.ShipmentDetailStatisticsService; | 32 | import com.lframework.xingyun.sc.service.statistics.ShipmentDetailStatisticsService; |
| 24 | import com.lframework.xingyun.sc.vo.statistics.shipmentDetail.CreateShipmentDetailStatisticsVo; | 33 | import com.lframework.xingyun.sc.vo.statistics.shipmentDetail.CreateShipmentDetailStatisticsVo; |
| 25 | import com.lframework.xingyun.sc.vo.statistics.shipmentDetail.QueryShipmentDetailStatisticsVo; | 34 | import com.lframework.xingyun.sc.vo.statistics.shipmentDetail.QueryShipmentDetailStatisticsVo; |
| @@ -41,6 +50,16 @@ public class ShipmentDetailStatisticsServiceImpl extends BaseMpServiceImpl<Shipm | @@ -41,6 +50,16 @@ public class ShipmentDetailStatisticsServiceImpl extends BaseMpServiceImpl<Shipm | ||
| 41 | private SysDeptService sysDeptService; | 50 | private SysDeptService sysDeptService; |
| 42 | @Resource | 51 | @Resource |
| 43 | private CustomerService customerService; | 52 | private CustomerService customerService; |
| 53 | + @Resource | ||
| 54 | + private CustomerShortService customerShortService; | ||
| 55 | + @Resource | ||
| 56 | + private CustomerCreditService customerCreditService; | ||
| 57 | + @Resource | ||
| 58 | + private SysDataDicItemService sysDataDicItemService; | ||
| 59 | + @Resource | ||
| 60 | + private ContractStdProcessingLineService contractStdProcessingLineService; | ||
| 61 | + @Resource | ||
| 62 | + private WorkshopService workshopService; | ||
| 44 | 63 | ||
| 45 | 64 | ||
| 46 | @Override | 65 | @Override |
| @@ -142,16 +161,26 @@ public class ShipmentDetailStatisticsServiceImpl extends BaseMpServiceImpl<Shipm | @@ -142,16 +161,26 @@ public class ShipmentDetailStatisticsServiceImpl extends BaseMpServiceImpl<Shipm | ||
| 142 | } | 161 | } |
| 143 | 162 | ||
| 144 | @Override | 163 | @Override |
| 145 | - public List<ShipmentDetailStatistics> getShipmentDetailInfo(String shipmentOrderId) { | ||
| 146 | - if (StringUtils.isBlank(shipmentOrderId)) { | ||
| 147 | - return Collections.emptyList(); | ||
| 148 | - } | ||
| 149 | - List<ShipmentDetailStatistics> shipmentDetailInfo = getBaseMapper().getShipmentDetailInfo(shipmentOrderId); | 164 | + public PageResult<ShipmentDetailStatistics> pageShipmentDetail(Integer pageIndex, Integer pageSize, QueryShipmentDetailStatisticsVo vo) { |
| 165 | + Assert.greaterThanZero(pageIndex); | ||
| 166 | + Assert.greaterThanZero(pageSize); | ||
| 167 | + | ||
| 168 | + PageHelperUtil.startPage(pageIndex, pageSize); | ||
| 169 | + List<ShipmentDetailStatistics> dataList = this.queryShipmentDetail(vo); | ||
| 170 | + | ||
| 171 | + return PageResultUtil.convert(new PageInfo<>(dataList)); | ||
| 172 | + } | ||
| 173 | + | ||
| 174 | + @Override | ||
| 175 | + public List<ShipmentDetailStatistics> queryShipmentDetail(QueryShipmentDetailStatisticsVo vo) { | ||
| 176 | + List<ShipmentDetailStatistics> shipmentDetailInfo = getBaseMapper().getShipmentDetailInfo(vo); | ||
| 150 | if (CollectionUtils.isEmpty(shipmentDetailInfo)) { | 177 | if (CollectionUtils.isEmpty(shipmentDetailInfo)) { |
| 151 | return Collections.emptyList(); | 178 | return Collections.emptyList(); |
| 152 | } | 179 | } |
| 153 | List<String> deptIds = new ArrayList<>(); | 180 | List<String> deptIds = new ArrayList<>(); |
| 154 | List<String> customerIds = new ArrayList<>(); | 181 | List<String> customerIds = new ArrayList<>(); |
| 182 | + List<String> contractIds = new ArrayList<>(); | ||
| 183 | + List<String> workshopIds = new ArrayList<>(); | ||
| 155 | for (ShipmentDetailStatistics detail : shipmentDetailInfo) { | 184 | for (ShipmentDetailStatistics detail : shipmentDetailInfo) { |
| 156 | if (StringUtils.isNotBlank(detail.getDeptId()) && !deptIds.contains(detail.getDeptId())) { | 185 | if (StringUtils.isNotBlank(detail.getDeptId()) && !deptIds.contains(detail.getDeptId())) { |
| 157 | deptIds.add(detail.getDeptId()); | 186 | deptIds.add(detail.getDeptId()); |
| @@ -165,36 +194,87 @@ public class ShipmentDetailStatisticsServiceImpl extends BaseMpServiceImpl<Shipm | @@ -165,36 +194,87 @@ public class ShipmentDetailStatisticsServiceImpl extends BaseMpServiceImpl<Shipm | ||
| 165 | if (StringUtils.isNotBlank(detail.getStockUpCompany()) && !customerIds.contains(detail.getStockUpCompany())) { | 194 | if (StringUtils.isNotBlank(detail.getStockUpCompany()) && !customerIds.contains(detail.getStockUpCompany())) { |
| 166 | customerIds.add(detail.getStockUpCompany()); | 195 | customerIds.add(detail.getStockUpCompany()); |
| 167 | } | 196 | } |
| 197 | + if (StringUtils.isNotBlank(detail.getContractId()) && !contractIds.contains(detail.getContractId())) { | ||
| 198 | + contractIds.add(detail.getContractId()); | ||
| 199 | + } | ||
| 200 | + if (StringUtils.isNotBlank(detail.getWorkshopId()) && !workshopIds.contains(detail.getWorkshopId())) { | ||
| 201 | + workshopIds.add(detail.getWorkshopId()); | ||
| 202 | + } | ||
| 168 | } | 203 | } |
| 169 | - Map<String, SysDept> deptMap = new HashMap<>(); | 204 | + // 获取厂房数据 |
| 205 | + List<Workshop> workshopList = workshopService.listByIds(workshopIds); | ||
| 206 | + Map<String, String> workshopMap = workshopList.stream().collect(Collectors.toMap(Workshop::getId, Workshop::getName)); | ||
| 170 | // 获取部门数据 | 207 | // 获取部门数据 |
| 171 | List<SysDept> deptList = sysDeptService.listByIds(deptIds); | 208 | List<SysDept> deptList = sysDeptService.listByIds(deptIds); |
| 172 | - if (CollectionUtils.isNotEmpty(deptList)) { | ||
| 173 | - deptMap = deptList.stream().collect(Collectors.toMap(SysDept::getId, Function.identity())); | ||
| 174 | - } | ||
| 175 | - Map<String, Customer> customerMap = new HashMap<>(); | 209 | + Map<String, SysDept> deptMap = deptList.stream().collect(Collectors.toMap(SysDept::getId, Function.identity())); |
| 176 | // 获取公司数据 | 210 | // 获取公司数据 |
| 177 | List<Customer> customerList = customerService.listByIds(customerIds); | 211 | List<Customer> customerList = customerService.listByIds(customerIds); |
| 178 | - if (CollectionUtils.isNotEmpty(customerList)) { | ||
| 179 | - customerMap = customerList.stream().collect(Collectors.toMap(Customer::getId, Function.identity())); | ||
| 180 | - } | 212 | + Map<String, Customer> customerMap = customerList.stream().collect(Collectors.toMap(Customer::getId, Function.identity())); |
| 213 | + // 客户简称数据 | ||
| 214 | + List<CustomerShort> customerShortList = customerShortService.listByCustomerId(customerIds); | ||
| 215 | + Map<String, String> customerShortMap = customerShortList.stream() | ||
| 216 | + .collect(Collectors.toMap(CustomerShort::getCustomerId, CustomerShort::getShortName, (v1, v2) -> v1)); | ||
| 217 | + // 客户资信数据 | ||
| 218 | + List<CustomerCredit> customerCreditList = customerCreditService.listByCustomerId(customerIds); | ||
| 219 | + Map<String, CustomerCredit> customerCreditMap = customerCreditList.stream() | ||
| 220 | + .collect(Collectors.toMap(CustomerCredit::getCompanyId, Function.identity(), (v1, v2) -> v1)); | ||
| 221 | + // 企业类型数据字典 | ||
| 222 | + List<SysDataDicItem> enterpriseTypeList = sysDataDicItemService.findByDicCode("ENTERPRISE_TYPE"); | ||
| 223 | + Map<String, String> enterpriseTypeMap = enterpriseTypeList.stream() | ||
| 224 | + .collect(Collectors.toMap(SysDataDicItem::getCode, SysDataDicItem::getName, (v1, v2) -> v1)); | ||
| 225 | + // 原材料与产品数量比 | ||
| 226 | + List<SysDataDicItem> materialAndQuantityRatioList = sysDataDicItemService.findByDicCode("RAW_TO_PROD_RATIO"); | ||
| 227 | + Map<String, String> materialAndQuantityRatioMap = materialAndQuantityRatioList.stream() | ||
| 228 | + .collect(Collectors.toMap(SysDataDicItem::getCode, SysDataDicItem::getName, (v1, v2) -> v1)); | ||
| 181 | for (ShipmentDetailStatistics detail : shipmentDetailInfo) { | 229 | for (ShipmentDetailStatistics detail : shipmentDetailInfo) { |
| 230 | + // 厂房 | ||
| 231 | + String workshopName = workshopMap.get(detail.getWorkshopId()); | ||
| 232 | + detail.setWorkshopName(workshopName); | ||
| 233 | + // 办事处 | ||
| 182 | SysDept sysDept = deptMap.get(detail.getDeptId()); | 234 | SysDept sysDept = deptMap.get(detail.getDeptId()); |
| 183 | if (sysDept != null) { | 235 | if (sysDept != null) { |
| 184 | detail.setDeptName(sysDept.getName()); | 236 | detail.setDeptName(sysDept.getName()); |
| 185 | } | 237 | } |
| 238 | + // 区域 | ||
| 186 | SysDept region = deptMap.get(detail.getRegion()); | 239 | SysDept region = deptMap.get(detail.getRegion()); |
| 187 | if (region != null) { | 240 | if (region != null) { |
| 188 | detail.setRegionName(region.getName()); | 241 | detail.setRegionName(region.getName()); |
| 189 | } | 242 | } |
| 243 | + // 客户类型 | ||
| 190 | Customer orderingUnit = customerMap.get(detail.getOrderingUnit()); | 244 | Customer orderingUnit = customerMap.get(detail.getOrderingUnit()); |
| 191 | if (orderingUnit != null) { | 245 | if (orderingUnit != null) { |
| 192 | detail.setOrderingUnitName(orderingUnit.getName()); | 246 | detail.setOrderingUnitName(orderingUnit.getName()); |
| 247 | + CustomerCredit customerCredit = customerCreditMap.get(orderingUnit.getId()); | ||
| 248 | + if (customerCredit != null) { | ||
| 249 | + String enterpriseType = enterpriseTypeMap.get(customerCredit.getEnterpriseType()); | ||
| 250 | + detail.setCustomerType(enterpriseType); | ||
| 251 | + } | ||
| 193 | } | 252 | } |
| 253 | + // 备货单位 | ||
| 194 | Customer stockUpCompany = customerMap.get(detail.getStockUpCompany()); | 254 | Customer stockUpCompany = customerMap.get(detail.getStockUpCompany()); |
| 195 | if (stockUpCompany != null) { | 255 | if (stockUpCompany != null) { |
| 196 | detail.setStockUpCompanyName(stockUpCompany.getName()); | 256 | detail.setStockUpCompanyName(stockUpCompany.getName()); |
| 197 | } | 257 | } |
| 258 | + // 简称 | ||
| 259 | + String shortName = customerShortMap.get(detail.getOrderingUnit()); | ||
| 260 | + if (StringUtils.isNotBlank(shortName)) { | ||
| 261 | + detail.setCustomerShortName(shortName); | ||
| 262 | + } | ||
| 263 | + // 回程运费 | ||
| 264 | + if ("PROCESS_STD_AGMT".equals(detail.getContractType())) { | ||
| 265 | + // 加工 | ||
| 266 | + detail.setReturnFreight(detail.getShippingCost()); | ||
| 267 | + detail.setShippingCost(null); | ||
| 268 | + } | ||
| 269 | + // 加工、经销 | ||
| 270 | + if (StringUtils.isNotBlank(detail.getMaterialProductRatio())) { | ||
| 271 | + String materialProductRatio = materialAndQuantityRatioMap.get(detail.getMaterialProductRatio()); | ||
| 272 | + if ("10".equals(detail.getMaterialProductRatio())) { | ||
| 273 | + detail.setProcessingOrDistribution(materialProductRatio + "加工"); | ||
| 274 | + } else { | ||
| 275 | + detail.setProcessingOrDistribution(detail.getMaterialProductRatioRemarks() + "加工"); | ||
| 276 | + } | ||
| 277 | + } | ||
| 198 | } | 278 | } |
| 199 | return shipmentDetailInfo; | 279 | return shipmentDetailInfo; |
| 200 | } | 280 | } |
| @@ -25,8 +25,8 @@ public interface ShipmentDetailStatisticsMapper extends BaseMapper<ShipmentDetai | @@ -25,8 +25,8 @@ public interface ShipmentDetailStatisticsMapper extends BaseMapper<ShipmentDetai | ||
| 25 | /** | 25 | /** |
| 26 | * 获取发货明细数据 | 26 | * 获取发货明细数据 |
| 27 | * | 27 | * |
| 28 | - * @param shipmentOrderId 发货单ID | ||
| 29 | - * @return List<ShipmentDetailStatistics> | 28 | + * @param QueryShipmentDetailStatisticsVo 发货单ID集合 |
| 29 | + * @return List<ShipmentDetailStatistics> | ||
| 30 | */ | 30 | */ |
| 31 | - List<ShipmentDetailStatistics> getShipmentDetailInfo(String shipmentOrderId); | 31 | + List<ShipmentDetailStatistics> getShipmentDetailInfo(@Param("vo") QueryShipmentDetailStatisticsVo vo); |
| 32 | } | 32 | } |
| @@ -54,8 +54,16 @@ public interface ShipmentDetailStatisticsService extends BaseMpService<ShipmentD | @@ -54,8 +54,16 @@ public interface ShipmentDetailStatisticsService extends BaseMpService<ShipmentD | ||
| 54 | /** | 54 | /** |
| 55 | * 获取发货明细数据 | 55 | * 获取发货明细数据 |
| 56 | * | 56 | * |
| 57 | - * @param shipmentOrderId 发货单ID | ||
| 58 | - * @return List<ShipmentDetailStatistics> | 57 | + * @param QueryShipmentDetailStatisticsVo 查询条件 |
| 58 | + * @return List<ShipmentDetailStatistics> | ||
| 59 | */ | 59 | */ |
| 60 | - List<ShipmentDetailStatistics> getShipmentDetailInfo(String shipmentOrderId); | 60 | + PageResult<ShipmentDetailStatistics> pageShipmentDetail(Integer pageIndex, Integer pageSize, QueryShipmentDetailStatisticsVo vo); |
| 61 | + | ||
| 62 | + /** | ||
| 63 | + * 获取发货明细数据 | ||
| 64 | + * | ||
| 65 | + * @param QueryShipmentDetailStatisticsVo 查询条件 | ||
| 66 | + * @return List<ShipmentDetailStatistics> | ||
| 67 | + */ | ||
| 68 | + List<ShipmentDetailStatistics> queryShipmentDetail(QueryShipmentDetailStatisticsVo vo); | ||
| 61 | } | 69 | } |
| @@ -58,6 +58,14 @@ public class CreateShipmentDetailStatisticsVo implements BaseVo, Serializable { | @@ -58,6 +58,14 @@ public class CreateShipmentDetailStatisticsVo implements BaseVo, Serializable { | ||
| 58 | private String orderingUnitName; | 58 | private String orderingUnitName; |
| 59 | 59 | ||
| 60 | /** | 60 | /** |
| 61 | + * 合同类型 | ||
| 62 | + */ | ||
| 63 | + @ApiModelProperty(value = "合同类型", required = true) | ||
| 64 | + @NotBlank(message = "请输入合同类型!") | ||
| 65 | + @Length(message = "合同类型最多允许20个字符!") | ||
| 66 | + private String contractType; | ||
| 67 | + | ||
| 68 | + /** | ||
| 61 | * 牌号 | 69 | * 牌号 |
| 62 | */ | 70 | */ |
| 63 | @ApiModelProperty(value = "牌号", required = true) | 71 | @ApiModelProperty(value = "牌号", required = true) |
| @@ -68,23 +76,21 @@ public class CreateShipmentDetailStatisticsVo implements BaseVo, Serializable { | @@ -68,23 +76,21 @@ public class CreateShipmentDetailStatisticsVo implements BaseVo, Serializable { | ||
| 68 | /** | 76 | /** |
| 69 | * 厚度 | 77 | * 厚度 |
| 70 | */ | 78 | */ |
| 71 | - @ApiModelProperty(value = "厚度", required = true) | ||
| 72 | - @NotNull(message = "请输入厚度!") | 79 | + @ApiModelProperty(value = "厚度") |
| 73 | @TypeMismatch(message = "厚度格式有误!") | 80 | @TypeMismatch(message = "厚度格式有误!") |
| 74 | private Double thickness; | 81 | private Double thickness; |
| 75 | 82 | ||
| 76 | /** | 83 | /** |
| 77 | * 宽度 | 84 | * 宽度 |
| 78 | */ | 85 | */ |
| 79 | - @ApiModelProperty(value = "宽度", required = true) | ||
| 80 | - @NotNull(message = "请输入宽度!") | 86 | + @ApiModelProperty(value = "宽度") |
| 81 | @TypeMismatch(message = "宽度格式有误!") | 87 | @TypeMismatch(message = "宽度格式有误!") |
| 82 | private Double width; | 88 | private Double width; |
| 83 | 89 | ||
| 84 | /** | 90 | /** |
| 85 | * 长度 | 91 | * 长度 |
| 86 | */ | 92 | */ |
| 87 | - @ApiModelProperty(value = "长度", required = true) | 93 | + @ApiModelProperty(value = "长度") |
| 88 | @NotNull(message = "请输入长度!") | 94 | @NotNull(message = "请输入长度!") |
| 89 | @TypeMismatch(message = "长度格式有误!") | 95 | @TypeMismatch(message = "长度格式有误!") |
| 90 | private Double length; | 96 | private Double length; |
| @@ -92,7 +98,7 @@ public class CreateShipmentDetailStatisticsVo implements BaseVo, Serializable { | @@ -92,7 +98,7 @@ public class CreateShipmentDetailStatisticsVo implements BaseVo, Serializable { | ||
| 92 | /** | 98 | /** |
| 93 | * 状态 | 99 | * 状态 |
| 94 | */ | 100 | */ |
| 95 | - @ApiModelProperty(value = "状态", required = true) | 101 | + @ApiModelProperty(value = "状态") |
| 96 | @NotBlank(message = "请输入状态!") | 102 | @NotBlank(message = "请输入状态!") |
| 97 | @Length(message = "状态最多允许50个字符!") | 103 | @Length(message = "状态最多允许50个字符!") |
| 98 | private String status; | 104 | private String status; |
| @@ -125,56 +131,49 @@ public class CreateShipmentDetailStatisticsVo implements BaseVo, Serializable { | @@ -125,56 +131,49 @@ public class CreateShipmentDetailStatisticsVo implements BaseVo, Serializable { | ||
| 125 | /** | 131 | /** |
| 126 | * 厚度公差正 | 132 | * 厚度公差正 |
| 127 | */ | 133 | */ |
| 128 | - @ApiModelProperty(value = "厚度公差正", required = true) | ||
| 129 | - @NotNull(message = "请输入厚度公差正!") | 134 | + @ApiModelProperty(value = "厚度公差正") |
| 130 | @TypeMismatch(message = "厚度公差正格式有误!") | 135 | @TypeMismatch(message = "厚度公差正格式有误!") |
| 131 | private Double thicknessTolPos; | 136 | private Double thicknessTolPos; |
| 132 | 137 | ||
| 133 | /** | 138 | /** |
| 134 | * 厚度公差负 | 139 | * 厚度公差负 |
| 135 | */ | 140 | */ |
| 136 | - @ApiModelProperty(value = "厚度公差负", required = true) | ||
| 137 | - @NotNull(message = "请输入厚度公差负!") | 141 | + @ApiModelProperty(value = "厚度公差负") |
| 138 | @TypeMismatch(message = "厚度公差负格式有误!") | 142 | @TypeMismatch(message = "厚度公差负格式有误!") |
| 139 | private Double thicknessTolNeg; | 143 | private Double thicknessTolNeg; |
| 140 | 144 | ||
| 141 | /** | 145 | /** |
| 142 | * 宽度公差正 | 146 | * 宽度公差正 |
| 143 | */ | 147 | */ |
| 144 | - @ApiModelProperty(value = "宽度公差正", required = true) | ||
| 145 | - @NotNull(message = "请输入宽度公差正!") | 148 | + @ApiModelProperty(value = "宽度公差正") |
| 146 | @TypeMismatch(message = "宽度公差正格式有误!") | 149 | @TypeMismatch(message = "宽度公差正格式有误!") |
| 147 | private Double widthTolPos; | 150 | private Double widthTolPos; |
| 148 | 151 | ||
| 149 | /** | 152 | /** |
| 150 | * 宽度公差负 | 153 | * 宽度公差负 |
| 151 | */ | 154 | */ |
| 152 | - @ApiModelProperty(value = "宽度公差负", required = true) | ||
| 153 | - @NotNull(message = "请输入宽度公差负!") | 155 | + @ApiModelProperty(value = "宽度公差负") |
| 154 | @TypeMismatch(message = "宽度公差负格式有误!") | 156 | @TypeMismatch(message = "宽度公差负格式有误!") |
| 155 | private Double widthTolNeg; | 157 | private Double widthTolNeg; |
| 156 | 158 | ||
| 157 | /** | 159 | /** |
| 158 | * 长度公差正 | 160 | * 长度公差正 |
| 159 | */ | 161 | */ |
| 160 | - @ApiModelProperty(value = "长度公差正", required = true) | ||
| 161 | - @NotNull(message = "请输入长度公差正!") | 162 | + @ApiModelProperty(value = "长度公差正") |
| 162 | @TypeMismatch(message = "长度公差正格式有误!") | 163 | @TypeMismatch(message = "长度公差正格式有误!") |
| 163 | private Double lengthTolPos; | 164 | private Double lengthTolPos; |
| 164 | 165 | ||
| 165 | /** | 166 | /** |
| 166 | * 长度公差负 | 167 | * 长度公差负 |
| 167 | */ | 168 | */ |
| 168 | - @ApiModelProperty(value = "长度公差负", required = true) | ||
| 169 | - @NotNull(message = "请输入长度公差负!") | 169 | + @ApiModelProperty(value = "长度公差负") |
| 170 | @TypeMismatch(message = "长度公差负格式有误!") | 170 | @TypeMismatch(message = "长度公差负格式有误!") |
| 171 | private Double lengthTolNeg; | 171 | private Double lengthTolNeg; |
| 172 | 172 | ||
| 173 | /** | 173 | /** |
| 174 | * 超协价 | 174 | * 超协价 |
| 175 | */ | 175 | */ |
| 176 | - @ApiModelProperty(value = "超协价", required = true) | ||
| 177 | - @NotBlank(message = "请输入超协价!") | 176 | + @ApiModelProperty(value = "超协价") |
| 178 | @Length(message = "超协价最多允许20个字符!") | 177 | @Length(message = "超协价最多允许20个字符!") |
| 179 | private String assessmentExceedsAgreement; | 178 | private String assessmentExceedsAgreement; |
| 180 | 179 |
| @@ -5,6 +5,7 @@ import com.lframework.starter.web.core.vo.PageVo; | @@ -5,6 +5,7 @@ import com.lframework.starter.web.core.vo.PageVo; | ||
| 5 | import com.lframework.starter.web.core.vo.BaseVo; | 5 | import com.lframework.starter.web.core.vo.BaseVo; |
| 6 | import io.swagger.annotations.ApiModelProperty; | 6 | import io.swagger.annotations.ApiModelProperty; |
| 7 | import java.io.Serializable; | 7 | import java.io.Serializable; |
| 8 | +import java.util.List; | ||
| 8 | 9 | ||
| 9 | @Data | 10 | @Data |
| 10 | public class QueryShipmentDetailStatisticsVo extends PageVo implements BaseVo, Serializable { | 11 | public class QueryShipmentDetailStatisticsVo extends PageVo implements BaseVo, Serializable { |
| @@ -12,6 +13,12 @@ public class QueryShipmentDetailStatisticsVo extends PageVo implements BaseVo, S | @@ -12,6 +13,12 @@ public class QueryShipmentDetailStatisticsVo extends PageVo implements BaseVo, S | ||
| 12 | private static final long serialVersionUID = 1L; | 13 | private static final long serialVersionUID = 1L; |
| 13 | 14 | ||
| 14 | /** | 15 | /** |
| 16 | + * 发货明细ID集合 | ||
| 17 | + */ | ||
| 18 | + @ApiModelProperty("发货明细ID集合") | ||
| 19 | + private List<String> ids; | ||
| 20 | + | ||
| 21 | + /** | ||
| 15 | * 生产厂 | 22 | * 生产厂 |
| 16 | */ | 23 | */ |
| 17 | @ApiModelProperty("生产厂") | 24 | @ApiModelProperty("生产厂") |
| @@ -29,4 +36,15 @@ public class QueryShipmentDetailStatisticsVo extends PageVo implements BaseVo, S | @@ -29,4 +36,15 @@ public class QueryShipmentDetailStatisticsVo extends PageVo implements BaseVo, S | ||
| 29 | @ApiModelProperty("订货单名称") | 36 | @ApiModelProperty("订货单名称") |
| 30 | private String orderingUnitName; | 37 | private String orderingUnitName; |
| 31 | 38 | ||
| 39 | + /** | ||
| 40 | + * 订单编号 | ||
| 41 | + */ | ||
| 42 | + @ApiModelProperty("订单编号") | ||
| 43 | + private String orderNo; | ||
| 44 | + | ||
| 45 | + /** | ||
| 46 | + * 发货单编号 | ||
| 47 | + */ | ||
| 48 | + @ApiModelProperty("发货单编号") | ||
| 49 | + private String shipmentOrderNo; | ||
| 32 | } | 50 | } |
| @@ -114,11 +114,70 @@ | @@ -114,11 +114,70 @@ | ||
| 114 | </select> | 114 | </select> |
| 115 | 115 | ||
| 116 | <select id="getShipmentDetailInfo" resultType="com.lframework.xingyun.sc.entity.ShipmentDetailStatistics"> | 116 | <select id="getShipmentDetailInfo" resultType="com.lframework.xingyun.sc.entity.ShipmentDetailStatistics"> |
| 117 | - select ol.*, o.*,w.name as workshop_name,sd.actual_shipment_quantity,sd.yield_batch_no | 117 | + select |
| 118 | + sd.id, | ||
| 119 | + sd.actual_shipment_quantity, | ||
| 120 | + sd.yield_batch_no, | ||
| 121 | + sd.num, | ||
| 122 | + ol.brand, | ||
| 123 | + ol.thickness, | ||
| 124 | + ol.width, | ||
| 125 | + ol.length, | ||
| 126 | + ol.status, | ||
| 127 | + ol.quantity, | ||
| 128 | + ol.sales_price, | ||
| 129 | + ol.thickness_tol_pos, | ||
| 130 | + ol.thickness_tol_neg, | ||
| 131 | + ol.width_tol_pos, | ||
| 132 | + ol.width_tol_neg, | ||
| 133 | + ol.length_tol_pos, | ||
| 134 | + ol.length_tol_neg, | ||
| 135 | + ol.assessment_exceeds_agreement, | ||
| 136 | + ol.industry, | ||
| 137 | + ol.packaging_fee, | ||
| 138 | + ol.quality, | ||
| 139 | + o.dept_id, | ||
| 140 | + o.region, | ||
| 141 | + o.ordering_unit, | ||
| 142 | + o.shipping_cost, | ||
| 143 | + o.delivery_method, | ||
| 144 | + o.stock_up_company_id, | ||
| 145 | + o.order_no, | ||
| 146 | + o.invoicing_status, | ||
| 147 | + o.order_date, | ||
| 148 | + o.settlement_terms, | ||
| 149 | + case | ||
| 150 | + when o.supply_unit = 'GJ' then '安徽楚江高精铜带有限公司' | ||
| 151 | + when o.supply_unit = 'XC' then '安徽楚江科技新材料股份有限公司' | ||
| 152 | + else '' | ||
| 153 | + end as supplier, | ||
| 154 | + o.workshop_id, | ||
| 155 | + so.code as shipment_order_no, | ||
| 156 | + so.create_time as shipment_date, | ||
| 157 | + sc.id as contract_id, | ||
| 158 | + sc.type as contract_type, | ||
| 159 | + sc.packaging_requirements, | ||
| 160 | + cl.material_product_ratio, | ||
| 161 | + cl.material_product_ratio_remarks | ||
| 118 | from shipments_plan_detail sd | 162 | from shipments_plan_detail sd |
| 119 | - left join tbl_purchase_order_line ol on sd.order_spec_id = ol.id | ||
| 120 | - left join purchase_order_info o on ol.purchase_order_id = o.id | ||
| 121 | - left join base_data_workshop w on o.workshop_id = w.id | ||
| 122 | - where sd.shipment_order_id = #{shipmentOrderId} | 163 | + inner join shipments_order_info so on sd.shipment_order_id = so.id |
| 164 | + left join tbl_purchase_order_line ol on sd.order_spec_id = ol.id | ||
| 165 | + left join purchase_order_info o on ol.purchase_order_id = o.id | ||
| 166 | + left join tbl_contract_distributor_standard sc on o.contract_id = sc.id | ||
| 167 | + left join tbl_contract_std_processing_line cl on sc.id = cl.contract_id | ||
| 168 | + <where> | ||
| 169 | + <if test="vo.ids != null and vo.ids.size() > 0"> | ||
| 170 | + and sd.id in | ||
| 171 | + <foreach collection="vo.ids" open="(" separator="," close=")" item="item"> | ||
| 172 | + #{item} | ||
| 173 | + </foreach> | ||
| 174 | + </if> | ||
| 175 | + <if test="vo.orderNo != null and vo.orderNo != ''"> | ||
| 176 | + AND o.order_no LIKE CONCAT('%', #{vo.orderNo}, '%') | ||
| 177 | + </if> | ||
| 178 | + <if test="vo.shipmentOrderNo != null and vo.shipmentOrderNo != ''"> | ||
| 179 | + AND so.code LIKE CONCAT('%', #{vo.shipmentOrderNo}, '%') | ||
| 180 | + </if> | ||
| 181 | + </where> | ||
| 123 | </select> | 182 | </select> |
| 124 | </mapper> | 183 | </mapper> |