Showing
13 changed files
with
114 additions
and
17 deletions
| ... | ... | @@ -31,6 +31,9 @@ public class GetAssaySelectableTicketBo { |
| 31 | 31 | @ApiModelProperty("分厂名称") |
| 32 | 32 | private String workshopName; |
| 33 | 33 | |
| 34 | + @ApiModelProperty("分厂编号") | |
| 35 | + private String workshopCode; | |
| 36 | + | |
| 34 | 37 | @ApiModelProperty("完成时间(第一次上传签字凭证时间)") |
| 35 | 38 | @JsonFormat(pattern = StringPool.DATE_TIME_PATTERN) |
| 36 | 39 | private LocalDateTime completeTime; | ... | ... |
| ... | ... | @@ -17,6 +17,7 @@ import com.lframework.xingyun.sc.procurement.vo.buyoutAccount.CreateBuyoutAccoun |
| 17 | 17 | import com.lframework.xingyun.sc.procurement.vo.buyoutAccount.QueryBuyoutAccountOrderVo; |
| 18 | 18 | import com.lframework.xingyun.sc.procurement.vo.buyoutAccount.QueryBuyoutAccountSummaryVo; |
| 19 | 19 | import com.lframework.xingyun.sc.procurement.vo.buyoutAccount.UpdateBuyoutAccountOrderVo; |
| 20 | +import com.lframework.xingyun.sc.procurement.vo.settle.QuerySettleOptionVo; | |
| 20 | 21 | import com.lframework.xingyun.sc.utils.ExcelUtil; |
| 21 | 22 | import com.lframework.xingyun.sc.utils.ResponseUtil; |
| 22 | 23 | import io.swagger.annotations.Api; |
| ... | ... | @@ -105,10 +106,11 @@ public class ProcurementBuyoutAccountOrderController extends DefaultBaseControll |
| 105 | 106 | return InvokeResultBuilder.success(buyoutAccountOrderService.findDetail(id)); |
| 106 | 107 | } |
| 107 | 108 | |
| 108 | - @ApiOperation("可制单的原料结算详情单下拉(审核通过 + 未作废 + 已生成审核通过的仓库收料单 + 未生成过买断入库核算单)") | |
| 109 | + @ApiOperation("可制单的原料结算详情单下拉(审核通过 + 未生成过有效买断入库核算单,已取消的不占用;支持码单编号/计划编号/供料单位/公司简称/分厂筛选)") | |
| 109 | 110 | @GetMapping("/settleOptions") |
| 110 | - public InvokeResult<List<GetBuyoutSettleDataBo>> getSettleOptions() { | |
| 111 | - return InvokeResultBuilder.success(buyoutAccountOrderService.getSettleOptions()); | |
| 111 | + public InvokeResult<List<GetBuyoutSettleDataBo>> getSettleOptions( | |
| 112 | + @Valid QuerySettleOptionVo vo) { | |
| 113 | + return InvokeResultBuilder.success(buyoutAccountOrderService.getSettleOptions(vo)); | |
| 112 | 114 | } |
| 113 | 115 | |
| 114 | 116 | @ApiOperation("新增页:按原料结算详情单带出数据(买断品种/买断数量/买断单价/入库数量/预计吨损耗等)") | ... | ... |
| ... | ... | @@ -16,6 +16,7 @@ import com.lframework.xingyun.sc.procurement.vo.receive.CreateWarehouseReceiveOr |
| 16 | 16 | import com.lframework.xingyun.sc.procurement.vo.receive.QueryWarehouseReceiveOrderVo; |
| 17 | 17 | import com.lframework.xingyun.sc.procurement.vo.receive.UpdateWarehouseReceiveActualQuantityVo; |
| 18 | 18 | import com.lframework.xingyun.sc.procurement.vo.receive.UpdateWarehouseReceiveOrderVo; |
| 19 | +import com.lframework.xingyun.sc.procurement.vo.settle.QuerySettleOptionVo; | |
| 19 | 20 | import com.lframework.xingyun.sc.utils.ExcelUtil; |
| 20 | 21 | import com.lframework.xingyun.sc.utils.ResponseUtil; |
| 21 | 22 | import io.swagger.annotations.Api; |
| ... | ... | @@ -104,10 +105,11 @@ public class ProcurementWarehouseReceiveOrderController extends DefaultBaseContr |
| 104 | 105 | return InvokeResultBuilder.success(warehouseReceiveOrderService.findDetail(id)); |
| 105 | 106 | } |
| 106 | 107 | |
| 107 | - @ApiOperation("可制单的原料结算详情单下拉(审核通过且未生成过有效仓库收料单,已取消的不占用)") | |
| 108 | + @ApiOperation("可制单的原料结算详情单下拉(审核通过且未生成过有效仓库收料单,已取消的不占用;支持码单编号/计划编号/供料单位/公司简称/分厂筛选)") | |
| 108 | 109 | @GetMapping("/settleOptions") |
| 109 | - public InvokeResult<List<GetWarehouseReceiveSettleDataBo>> getSettleOptions() { | |
| 110 | - return InvokeResultBuilder.success(warehouseReceiveOrderService.getSettleOptions()); | |
| 110 | + public InvokeResult<List<GetWarehouseReceiveSettleDataBo>> getSettleOptions( | |
| 111 | + @Valid QuerySettleOptionVo vo) { | |
| 112 | + return InvokeResultBuilder.success(warehouseReceiveOrderService.getSettleOptions(vo)); | |
| 111 | 113 | } |
| 112 | 114 | |
| 113 | 115 | @ApiOperation("新增页:按原料结算详情单带出数据(明细自动计算,没有类别的不代入)") | ... | ... |
| ... | ... | @@ -65,6 +65,7 @@ import com.lframework.xingyun.sc.procurement.vo.buyoutAccount.QueryBuyoutAccount |
| 65 | 65 | import com.lframework.xingyun.sc.procurement.vo.buyoutAccount.QueryBuyoutAccountSummaryVo; |
| 66 | 66 | import com.lframework.xingyun.sc.procurement.vo.buyoutAccount.UpdateBuyoutAccountOrderVo; |
| 67 | 67 | import com.lframework.xingyun.sc.procurement.vo.buyoutAccount.BuyoutAccountOrderLineVo; |
| 68 | +import com.lframework.xingyun.sc.procurement.vo.settle.QuerySettleOptionVo; | |
| 68 | 69 | import com.lframework.xingyun.sc.utils.ExcelUtil; |
| 69 | 70 | import com.lframework.xingyun.sc.utils.ResponseUtil; |
| 70 | 71 | |
| ... | ... | @@ -214,9 +215,9 @@ public class ProcurementBuyoutAccountOrderServiceImpl |
| 214 | 215 | } |
| 215 | 216 | |
| 216 | 217 | @Override |
| 217 | - public List<GetBuyoutSettleDataBo> getSettleOptions() { | |
| 218 | - // 可制单的原料结算详情单:审核通过 + 未作废 + 数据权限按分厂过滤(收料单审核通过的条件在循环内校验) | |
| 219 | - List<ProcurementMaterialSettleDetail> settles = settleDetailMapper.querySettleOptions(); | |
| 218 | + public List<GetBuyoutSettleDataBo> getSettleOptions(QuerySettleOptionVo vo) { | |
| 219 | + // 可制单的原料结算详情单:审核通过 + 未作废 + 数据权限按分厂过滤 + 筛选项(收料单审核通过的条件在循环内校验) | |
| 220 | + List<ProcurementMaterialSettleDetail> settles = settleDetailMapper.querySettleOptions(vo); | |
| 220 | 221 | if (CollectionUtil.isEmpty(settles)) { |
| 221 | 222 | return new ArrayList<>(); |
| 222 | 223 | } | ... | ... |
| ... | ... | @@ -55,6 +55,7 @@ import com.lframework.xingyun.sc.procurement.vo.receive.QueryWarehouseReceiveOrd |
| 55 | 55 | import com.lframework.xingyun.sc.procurement.vo.receive.UpdateWarehouseReceiveActualQuantityVo; |
| 56 | 56 | import com.lframework.xingyun.sc.procurement.vo.receive.UpdateWarehouseReceiveOrderVo; |
| 57 | 57 | import com.lframework.xingyun.sc.procurement.vo.receive.WarehouseReceiveOrderLineVo; |
| 58 | +import com.lframework.xingyun.sc.procurement.vo.settle.QuerySettleOptionVo; | |
| 58 | 59 | |
| 59 | 60 | import java.math.BigDecimal; |
| 60 | 61 | import java.time.LocalDate; |
| ... | ... | @@ -213,9 +214,9 @@ public class ProcurementWarehouseReceiveOrderServiceImpl |
| 213 | 214 | } |
| 214 | 215 | |
| 215 | 216 | @Override |
| 216 | - public List<GetWarehouseReceiveSettleDataBo> getSettleOptions() { | |
| 217 | - // 可制单的原料结算详情单:审核通过 + 未作废 + 数据权限按分厂过滤,且未生成过仓库收料单 | |
| 218 | - List<ProcurementMaterialSettleDetail> settles = settleDetailMapper.querySettleOptions(); | |
| 217 | + public List<GetWarehouseReceiveSettleDataBo> getSettleOptions(QuerySettleOptionVo vo) { | |
| 218 | + // 可制单的原料结算详情单:审核通过 + 未作废 + 数据权限按分厂过滤 + 筛选项,且未生成过仓库收料单 | |
| 219 | + List<ProcurementMaterialSettleDetail> settles = settleDetailMapper.querySettleOptions(vo); | |
| 219 | 220 | if (CollectionUtil.isEmpty(settles)) { |
| 220 | 221 | return new ArrayList<>(); |
| 221 | 222 | } | ... | ... |
| ... | ... | @@ -10,6 +10,7 @@ import com.lframework.xingyun.sc.bo.procurement.GetMaterialSettleSelectableTicke |
| 10 | 10 | import com.lframework.xingyun.sc.procurement.entity.settle.ProcurementMaterialSettleDetail; |
| 11 | 11 | import com.lframework.xingyun.sc.procurement.vo.settle.QueryMaterialSettleSelectableTicketVo; |
| 12 | 12 | import com.lframework.xingyun.sc.procurement.vo.settle.QueryProcurementMaterialSettleDetailVo; |
| 13 | +import com.lframework.xingyun.sc.procurement.vo.settle.QuerySettleOptionVo; | |
| 13 | 14 | |
| 14 | 15 | import java.util.List; |
| 15 | 16 | |
| ... | ... | @@ -44,12 +45,13 @@ public interface ProcurementMaterialSettleDetailMapper |
| 44 | 45 | List<GetMaterialSettlePlanLineOptionBo> queryPlanLineOptions(@Param("planId") String planId); |
| 45 | 46 | |
| 46 | 47 | /** |
| 47 | - * 可制单的原料结算详情单(审核通过 + 未作废,数据权限按分厂过滤) | |
| 48 | + * 可制单的原料结算详情单(审核通过 + 未作废 + 数据权限按分厂过滤,支持码单编号/计划编号/供料单位/公司简称/分厂筛选) | |
| 48 | 49 | */ |
| 49 | 50 | @DataPermissions(type = OrderDataPermissionDataPermissionType.class, value = { |
| 50 | 51 | @DataPermission(template = "order", alias = "tb") |
| 51 | 52 | }) |
| 52 | - List<ProcurementMaterialSettleDetail> querySettleOptions(); | |
| 53 | + List<ProcurementMaterialSettleDetail> querySettleOptions( | |
| 54 | + @Param("vo") QuerySettleOptionVo vo); | |
| 53 | 55 | |
| 54 | 56 | /** |
| 55 | 57 | * 单条查询(联表带出分厂编号 workshopCode;实体传给流程引擎/分厂审核节点路由前必须用此方法) | ... | ... |
| ... | ... | @@ -10,6 +10,7 @@ import com.lframework.xingyun.sc.procurement.vo.buyoutAccount.CreateBuyoutAccoun |
| 10 | 10 | import com.lframework.xingyun.sc.procurement.vo.buyoutAccount.QueryBuyoutAccountOrderVo; |
| 11 | 11 | import com.lframework.xingyun.sc.procurement.vo.buyoutAccount.QueryBuyoutAccountSummaryVo; |
| 12 | 12 | import com.lframework.xingyun.sc.procurement.vo.buyoutAccount.UpdateBuyoutAccountOrderVo; |
| 13 | +import com.lframework.xingyun.sc.procurement.vo.settle.QuerySettleOptionVo; | |
| 13 | 14 | |
| 14 | 15 | import javax.servlet.http.HttpServletResponse; |
| 15 | 16 | import java.io.IOException; |
| ... | ... | @@ -31,9 +32,9 @@ public interface ProcurementBuyoutAccountOrderService |
| 31 | 32 | GetBuyoutAccountOrderBo findDetail(String id); |
| 32 | 33 | |
| 33 | 34 | /** |
| 34 | - * 可制单的原料结算详情单下拉(审核通过 + 未作废 + 已生成审核通过的仓库收料单 + 未生成过买断入库核算单) | |
| 35 | + * 可制单的原料结算详情单下拉(审核通过 + 未生成过有效买断入库核算单,已取消的不占用;支持码单编号/计划编号/供料单位/公司简称/分厂筛选) | |
| 35 | 36 | */ |
| 36 | - List<GetBuyoutSettleDataBo> getSettleOptions(); | |
| 37 | + List<GetBuyoutSettleDataBo> getSettleOptions(QuerySettleOptionVo vo); | |
| 37 | 38 | |
| 38 | 39 | /** |
| 39 | 40 | * 新增页:按原料结算详情单带出数据(分厂仓库统计员制单) | ... | ... |
| ... | ... | @@ -9,6 +9,7 @@ import com.lframework.xingyun.sc.procurement.vo.receive.CreateWarehouseReceiveOr |
| 9 | 9 | import com.lframework.xingyun.sc.procurement.vo.receive.QueryWarehouseReceiveOrderVo; |
| 10 | 10 | import com.lframework.xingyun.sc.procurement.vo.receive.UpdateWarehouseReceiveActualQuantityVo; |
| 11 | 11 | import com.lframework.xingyun.sc.procurement.vo.receive.UpdateWarehouseReceiveOrderVo; |
| 12 | +import com.lframework.xingyun.sc.procurement.vo.settle.QuerySettleOptionVo; | |
| 12 | 13 | |
| 13 | 14 | import java.util.List; |
| 14 | 15 | import java.util.Map; |
| ... | ... | @@ -30,7 +31,7 @@ public interface ProcurementWarehouseReceiveOrderService |
| 30 | 31 | /** |
| 31 | 32 | * 可制单的原料结算详情单下拉(审核通过且未生成过仓库收料单) |
| 32 | 33 | */ |
| 33 | - List<GetWarehouseReceiveSettleDataBo> getSettleOptions(); | |
| 34 | + List<GetWarehouseReceiveSettleDataBo> getSettleOptions(QuerySettleOptionVo vo); | |
| 34 | 35 | |
| 35 | 36 | /** |
| 36 | 37 | * 新增页:按原料结算详情单带出数据(日期+1天、材料来源、计划编号、分厂、明细自动计算; | ... | ... |
| ... | ... | @@ -16,6 +16,15 @@ public class QueryMaterialSettleSelectableTicketVo extends SortPageVo implements |
| 16 | 16 | @ApiModelProperty("码单编号(模糊匹配)") |
| 17 | 17 | private String code; |
| 18 | 18 | |
| 19 | + @ApiModelProperty("计划编号(模糊匹配)") | |
| 20 | + private String planCode; | |
| 21 | + | |
| 22 | + @ApiModelProperty("供料单位(模糊匹配)") | |
| 23 | + private String supplierName; | |
| 24 | + | |
| 25 | + @ApiModelProperty("公司简称(模糊匹配)") | |
| 26 | + private String companyShortName; | |
| 27 | + | |
| 19 | 28 | @ApiModelProperty("分厂ID(按分厂划分,可选)") |
| 20 | 29 | private String workshopId; |
| 21 | 30 | } | ... | ... |
| ... | ... | @@ -16,6 +16,15 @@ public class QueryAssaySelectableTicketVo extends SortPageVo implements Serializ |
| 16 | 16 | @ApiModelProperty("码单编号(模糊匹配)") |
| 17 | 17 | private String code; |
| 18 | 18 | |
| 19 | + @ApiModelProperty("计划编号(模糊匹配)") | |
| 20 | + private String planCode; | |
| 21 | + | |
| 22 | + @ApiModelProperty("供料单位(模糊匹配)") | |
| 23 | + private String supplierName; | |
| 24 | + | |
| 25 | + @ApiModelProperty("公司简称(模糊匹配)") | |
| 26 | + private String companyShortName; | |
| 27 | + | |
| 19 | 28 | @ApiModelProperty("分厂ID(按分厂划分,可选)") |
| 20 | 29 | private String workshopId; |
| 21 | 30 | } | ... | ... |
| ... | ... | @@ -145,6 +145,30 @@ |
| 145 | 145 | <include refid="PMSD_sql"/> |
| 146 | 146 | WHERE tb.deleted = 0 |
| 147 | 147 | AND tb.approval_status = 'PASS' |
| 148 | + <if test="vo.code != null and vo.code != ''"> | |
| 149 | + AND tb.weighing_ticket_code LIKE CONCAT('%', #{vo.code}, '%') | |
| 150 | + </if> | |
| 151 | + <if test="vo.planCode != null and vo.planCode != ''"> | |
| 152 | + AND EXISTS ( | |
| 153 | + SELECT 1 FROM procurement_material_settle_line pmslf | |
| 154 | + LEFT JOIN procurement_plan ppf ON ppf.id = pmslf.procurement_plan_id | |
| 155 | + WHERE pmslf.settle_detail_id = tb.id | |
| 156 | + AND ppf.code LIKE CONCAT('%', #{vo.planCode}, '%') | |
| 157 | + ) | |
| 158 | + </if> | |
| 159 | + <if test="vo.supplierName != null and vo.supplierName != ''"> | |
| 160 | + AND tb.supplier_name LIKE CONCAT('%', #{vo.supplierName}, '%') | |
| 161 | + </if> | |
| 162 | + <if test="vo.companyShortName != null and vo.companyShortName != ''"> | |
| 163 | + AND EXISTS ( | |
| 164 | + SELECT 1 FROM procurement_weighing_ticket pwtf | |
| 165 | + WHERE pwtf.id = tb.weighing_ticket_id | |
| 166 | + AND pwtf.company_short_name LIKE CONCAT('%', #{vo.companyShortName}, '%') | |
| 167 | + ) | |
| 168 | + </if> | |
| 169 | + <if test="vo.workshopId != null and vo.workshopId != ''"> | |
| 170 | + AND tb.workshop_id = #{vo.workshopId} | |
| 171 | + </if> | |
| 148 | 172 | ORDER BY tb.create_time DESC |
| 149 | 173 | </select> |
| 150 | 174 | |
| ... | ... | @@ -216,6 +240,19 @@ |
| 216 | 240 | <if test="vo.code != null and vo.code != ''"> |
| 217 | 241 | AND tb.code LIKE CONCAT('%', #{vo.code}, '%') |
| 218 | 242 | </if> |
| 243 | + <if test="vo.planCode != null and vo.planCode != ''"> | |
| 244 | + AND EXISTS ( | |
| 245 | + SELECT 1 FROM procurement_weighing_ticket_plan pwtpf | |
| 246 | + WHERE pwtpf.weighing_ticket_id = tb.id | |
| 247 | + AND pwtpf.plan_code LIKE CONCAT('%', #{vo.planCode}, '%') | |
| 248 | + ) | |
| 249 | + </if> | |
| 250 | + <if test="vo.supplierName != null and vo.supplierName != ''"> | |
| 251 | + AND tb.supplier_name LIKE CONCAT('%', #{vo.supplierName}, '%') | |
| 252 | + </if> | |
| 253 | + <if test="vo.companyShortName != null and vo.companyShortName != ''"> | |
| 254 | + AND tb.company_short_name LIKE CONCAT('%', #{vo.companyShortName}, '%') | |
| 255 | + </if> | |
| 219 | 256 | <if test="vo.workshopId != null and vo.workshopId != ''"> |
| 220 | 257 | AND tb.workshop_id = #{vo.workshopId} |
| 221 | 258 | </if> | ... | ... |
| ... | ... | @@ -146,6 +146,19 @@ |
| 146 | 146 | <if test="vo.code != null and vo.code != ''"> |
| 147 | 147 | AND tb.code LIKE CONCAT('%', #{vo.code}, '%') |
| 148 | 148 | </if> |
| 149 | + <if test="vo.planCode != null and vo.planCode != ''"> | |
| 150 | + AND EXISTS ( | |
| 151 | + SELECT 1 FROM procurement_weighing_ticket_plan pwtpf | |
| 152 | + WHERE pwtpf.weighing_ticket_id = tb.id | |
| 153 | + AND pwtpf.plan_code LIKE CONCAT('%', #{vo.planCode}, '%') | |
| 154 | + ) | |
| 155 | + </if> | |
| 156 | + <if test="vo.supplierName != null and vo.supplierName != ''"> | |
| 157 | + AND tb.supplier_name LIKE CONCAT('%', #{vo.supplierName}, '%') | |
| 158 | + </if> | |
| 159 | + <if test="vo.companyShortName != null and vo.companyShortName != ''"> | |
| 160 | + AND tb.company_short_name LIKE CONCAT('%', #{vo.companyShortName}, '%') | |
| 161 | + </if> | |
| 149 | 162 | <if test="vo.workshopId != null and vo.workshopId != ''"> |
| 150 | 163 | AND tb.workshop_id = #{vo.workshopId} |
| 151 | 164 | </if> | ... | ... |
| ... | ... | @@ -146,6 +146,7 @@ |
| 146 | 146 | <result column="supplier_name" property="supplierName"/> |
| 147 | 147 | <result column="workshop_id" property="workshopId"/> |
| 148 | 148 | <result column="workshop_name" property="workshopName"/> |
| 149 | + <result column="workshop_code" property="workshopCode"/> | |
| 149 | 150 | <result column="complete_time" property="completeTime"/> |
| 150 | 151 | <result column="create_by" property="createBy"/> |
| 151 | 152 | <result column="plan_codes" property="planCodes"/> |
| ... | ... | @@ -161,6 +162,7 @@ |
| 161 | 162 | tb.company_short_name, |
| 162 | 163 | tb.workshop_id, |
| 163 | 164 | tb.workshop_name, |
| 165 | + ws.code AS workshop_code, | |
| 164 | 166 | tb.complete_time, |
| 165 | 167 | tb.create_by, |
| 166 | 168 | ( |
| ... | ... | @@ -169,6 +171,7 @@ |
| 169 | 171 | WHERE pwtp.weighing_ticket_id = tb.id |
| 170 | 172 | ) AS plan_codes |
| 171 | 173 | FROM procurement_weighing_ticket AS tb |
| 174 | + LEFT JOIN base_data_workshop ws ON ws.id = tb.workshop_id | |
| 172 | 175 | WHERE tb.deleted = 0 |
| 173 | 176 | AND tb.approval_status = 'PASS' |
| 174 | 177 | AND tb.complete_time IS NOT NULL |
| ... | ... | @@ -195,6 +198,19 @@ |
| 195 | 198 | <if test="vo.code != null and vo.code != ''"> |
| 196 | 199 | AND tb.code LIKE CONCAT('%', #{vo.code}, '%') |
| 197 | 200 | </if> |
| 201 | + <if test="vo.planCode != null and vo.planCode != ''"> | |
| 202 | + AND EXISTS ( | |
| 203 | + SELECT 1 FROM procurement_weighing_ticket_plan pwtpf | |
| 204 | + WHERE pwtpf.weighing_ticket_id = tb.id | |
| 205 | + AND pwtpf.plan_code LIKE CONCAT('%', #{vo.planCode}, '%') | |
| 206 | + ) | |
| 207 | + </if> | |
| 208 | + <if test="vo.supplierName != null and vo.supplierName != ''"> | |
| 209 | + AND tb.supplier_name LIKE CONCAT('%', #{vo.supplierName}, '%') | |
| 210 | + </if> | |
| 211 | + <if test="vo.companyShortName != null and vo.companyShortName != ''"> | |
| 212 | + AND tb.company_short_name LIKE CONCAT('%', #{vo.companyShortName}, '%') | |
| 213 | + </if> | |
| 198 | 214 | <if test="vo.workshopId != null and vo.workshopId != ''"> |
| 199 | 215 | AND tb.workshop_id = #{vo.workshopId} |
| 200 | 216 | </if> | ... | ... |