Commit 589321363b7cde08691abfaf5d1e399cb2a4ee4a

Authored by 房远帅
2 parents 2ba19839 8429755f

Merge branch 'master_chujiang_0731' into master_quotation

@@ -2,6 +2,7 @@ package com.lframework.xingyun.sc.controller.shipments.car; @@ -2,6 +2,7 @@ package com.lframework.xingyun.sc.controller.shipments.car;
2 2
3 import cn.hutool.core.io.resource.ClassPathResource; 3 import cn.hutool.core.io.resource.ClassPathResource;
4 import com.lframework.starter.web.core.annotations.security.HasPermission; 4 import com.lframework.starter.web.core.annotations.security.HasPermission;
  5 +import com.lframework.starter.web.core.components.security.SecurityUtil;
5 import com.lframework.starter.web.core.controller.DefaultBaseController; 6 import com.lframework.starter.web.core.controller.DefaultBaseController;
6 import com.lframework.starter.web.core.utils.PageResultUtil; 7 import com.lframework.starter.web.core.utils.PageResultUtil;
7 import com.lframework.starter.web.core.components.resp.PageResult; 8 import com.lframework.starter.web.core.components.resp.PageResult;
@@ -13,6 +14,8 @@ import com.lframework.xingyun.sc.entity.CarRequestPlan; @@ -13,6 +14,8 @@ import com.lframework.xingyun.sc.entity.CarRequestPlan;
13 import com.lframework.xingyun.sc.entity.RequestCarTicket; 14 import com.lframework.xingyun.sc.entity.RequestCarTicket;
14 import com.lframework.xingyun.sc.service.shipments.car.CarRequestPlanService; 15 import com.lframework.xingyun.sc.service.shipments.car.CarRequestPlanService;
15 import com.lframework.xingyun.sc.service.shipments.car.RequestCarTicketService; 16 import com.lframework.xingyun.sc.service.shipments.car.RequestCarTicketService;
  17 +import com.lframework.starter.web.inner.service.system.SysRoleService;
  18 +import com.lframework.starter.web.inner.entity.SysRole;
16 import com.lframework.xingyun.sc.vo.shipments.car.CreateCarRequestPlanVo; 19 import com.lframework.xingyun.sc.vo.shipments.car.CreateCarRequestPlanVo;
17 import com.lframework.xingyun.sc.vo.shipments.car.QueryCarRequestPlanVo; 20 import com.lframework.xingyun.sc.vo.shipments.car.QueryCarRequestPlanVo;
18 import com.lframework.xingyun.sc.vo.shipments.car.QueryRequestCarTicketVo; 21 import com.lframework.xingyun.sc.vo.shipments.car.QueryRequestCarTicketVo;
@@ -62,6 +65,8 @@ public class CarRequestPlanController extends DefaultBaseController { @@ -62,6 +65,8 @@ public class CarRequestPlanController extends DefaultBaseController {
62 private CarRequestPlanService carRequestPlanService; 65 private CarRequestPlanService carRequestPlanService;
63 @Autowired 66 @Autowired
64 private RequestCarTicketService requestCarTicketService; 67 private RequestCarTicketService requestCarTicketService;
  68 + @Autowired
  69 + private SysRoleService sysRoleService;
65 70
66 /** 71 /**
67 * 查询列表 72 * 查询列表
@@ -71,6 +76,9 @@ public class CarRequestPlanController extends DefaultBaseController { @@ -71,6 +76,9 @@ public class CarRequestPlanController extends DefaultBaseController {
71 @GetMapping("/query") 76 @GetMapping("/query")
72 public InvokeResult<PageResult<GetCarRequestPlanBo>> query(@Valid QueryCarRequestPlanVo vo) { 77 public InvokeResult<PageResult<GetCarRequestPlanBo>> query(@Valid QueryCarRequestPlanVo vo) {
73 78
  79 + // wlgs角色只能查看要车单运作科审核人已填写的数据
  80 + applyWlgsRoleFilter(vo);
  81 +
74 PageResult<CarRequestPlan> pageResult = carRequestPlanService.query(getPageIndex(vo), getPageSize(vo), vo); 82 PageResult<CarRequestPlan> pageResult = carRequestPlanService.query(getPageIndex(vo), getPageSize(vo), vo);
75 83
76 List<CarRequestPlan> datas = pageResult.getDatas(); 84 List<CarRequestPlan> datas = pageResult.getDatas();
@@ -338,4 +346,19 @@ public class CarRequestPlanController extends DefaultBaseController { @@ -338,4 +346,19 @@ public class CarRequestPlanController extends DefaultBaseController {
338 346
339 return result; 347 return result;
340 } 348 }
  349 +
  350 + /**
  351 + * wlgs角色只能查看要车单运作科审核人已填写的数据
  352 + */
  353 + private void applyWlgsRoleFilter(QueryCarRequestPlanVo vo) {
  354 + String currentUserId = SecurityUtil.getCurrentUser().getId();
  355 + List<SysRole> roles = sysRoleService.getByUserId(currentUserId);
  356 + if (CollectionUtil.isEmpty(roles)) {
  357 + return;
  358 + }
  359 + List<String> roleCodes = roles.stream().map(SysRole::getCode).collect(Collectors.toList());
  360 + if (roleCodes.contains("wlgs")) {
  361 + vo.setOperationsDepartmentAuditorNotNull(true);
  362 + }
  363 + }
341 } 364 }
@@ -44,7 +44,7 @@ public class RequestCarTicketController extends DefaultBaseController { @@ -44,7 +44,7 @@ public class RequestCarTicketController extends DefaultBaseController {
44 * 查询列表 44 * 查询列表
45 */ 45 */
46 @ApiOperation("查询列表") 46 @ApiOperation("查询列表")
47 - @HasPermission({"shipping-plan-manage:car-request-order:query"}) 47 + @HasPermission({"shipping-plan-manage:car-request-order:query", "shipping-plan-manage:car-request-plan:query"})
48 @GetMapping("/query") 48 @GetMapping("/query")
49 public InvokeResult<PageResult<GetRequestCarTicketBo>> query(@Valid QueryRequestCarTicketVo vo) { 49 public InvokeResult<PageResult<GetRequestCarTicketBo>> query(@Valid QueryRequestCarTicketVo vo) {
50 50
@@ -31,5 +31,10 @@ public class QueryCarRequestPlanVo extends PageVo implements BaseVo, Serializabl @@ -31,5 +31,10 @@ public class QueryCarRequestPlanVo extends PageVo implements BaseVo, Serializabl
31 @ApiModelProperty("装货厂别") 31 @ApiModelProperty("装货厂别")
32 private String workshopId; 32 private String workshopId;
33 33
  34 + /**
  35 + * 是否只查运作科审核人已填写的数据(wlgs角色专用)
  36 + */
  37 + @ApiModelProperty("是否只查运作科审核人已填写的数据")
  38 + private Boolean operationsDepartmentAuditorNotNull;
34 39
35 } 40 }
@@ -59,4 +59,10 @@ public class QueryShipmentDetailStatisticsVo extends PageVo implements BaseVo, S @@ -59,4 +59,10 @@ public class QueryShipmentDetailStatisticsVo extends PageVo implements BaseVo, S
59 59
60 @ApiModelProperty("订货日期") 60 @ApiModelProperty("订货日期")
61 private String orderDateEnd; 61 private String orderDateEnd;
  62 +
  63 + @ApiModelProperty("发货日期")
  64 + private String shipmentDateStart;
  65 +
  66 + @ApiModelProperty("发货日期")
  67 + private String shipmentDateEnd;
62 } 68 }
@@ -47,6 +47,14 @@ @@ -47,6 +47,14 @@
47 <if test="vo.workshopId != null and vo.workshopId != ''"> 47 <if test="vo.workshopId != null and vo.workshopId != ''">
48 AND tb.workshop_id = #{vo.workshopId} 48 AND tb.workshop_id = #{vo.workshopId}
49 </if> 49 </if>
  50 + <if test="vo.operationsDepartmentAuditorNotNull != null and vo.operationsDepartmentAuditorNotNull == true">
  51 + AND EXISTS (
  52 + SELECT 1 FROM request_car_ticket rct
  53 + WHERE rct.plan_id = tb.id
  54 + AND rct.operations_department_auditor IS NOT NULL
  55 + AND rct.operations_department_auditor != ''
  56 + )
  57 + </if>
50 </where> 58 </where>
51 ORDER BY tb.request_car_date DESC 59 ORDER BY tb.request_car_date DESC
52 </select> 60 </select>
@@ -124,6 +124,14 @@ @@ -124,6 +124,14 @@
124 AND tb.order_date <= #{vo.orderDateEnd} 124 AND tb.order_date <= #{vo.orderDateEnd}
125 ]]> 125 ]]>
126 </if> 126 </if>
  127 + <if test="vo.shipmentDateStart != null">
  128 + AND tb.shipment_date >= #{vo.shipmentDateStart}
  129 + </if>
  130 + <if test="vo.shipmentDateEnd != null">
  131 + <![CDATA[
  132 + AND tb.shipment_date <= #{vo.shipmentDateEnd}
  133 + ]]>
  134 + </if>
127 </where> 135 </where>
128 ORDER BY tb.shipment_date DESC 136 ORDER BY tb.shipment_date DESC
129 </select> 137 </select>