Showing
10 changed files
with
205 additions
and
13 deletions
| ... | ... | @@ -39,6 +39,12 @@ public class GetRequestCarTicketBo extends BaseBo<RequestCarTicket> { |
| 39 | 39 | private String deptId; |
| 40 | 40 | |
| 41 | 41 | /** |
| 42 | + * 要车办事处名称 | |
| 43 | + */ | |
| 44 | + @ApiModelProperty("要车办事处名称") | |
| 45 | + private String deptName; | |
| 46 | + | |
| 47 | + /** | |
| 42 | 48 | * 计划装货日期 |
| 43 | 49 | */ |
| 44 | 50 | @ApiModelProperty("计划装货日期") |
| ... | ... | @@ -52,6 +58,12 @@ public class GetRequestCarTicketBo extends BaseBo<RequestCarTicket> { |
| 52 | 58 | private String workshopId; |
| 53 | 59 | |
| 54 | 60 | /** |
| 61 | + * 装货厂别名称 | |
| 62 | + */ | |
| 63 | + @ApiModelProperty("装货厂别名称") | |
| 64 | + private String workshopName; | |
| 65 | + | |
| 66 | + /** | |
| 55 | 67 | * 订单编号 |
| 56 | 68 | */ |
| 57 | 69 | @ApiModelProperty("订单编号") |
| ... | ... | @@ -106,6 +118,12 @@ public class GetRequestCarTicketBo extends BaseBo<RequestCarTicket> { |
| 106 | 118 | private String externalAuditor; |
| 107 | 119 | |
| 108 | 120 | /** |
| 121 | + * 外办审核人名称 | |
| 122 | + */ | |
| 123 | + @ApiModelProperty("外办审核人名称") | |
| 124 | + private String externalAuditorName; | |
| 125 | + | |
| 126 | + /** | |
| 109 | 127 | * 装货时间 |
| 110 | 128 | */ |
| 111 | 129 | @ApiModelProperty("装货时间") |
| ... | ... | @@ -124,11 +142,29 @@ public class GetRequestCarTicketBo extends BaseBo<RequestCarTicket> { |
| 124 | 142 | private String businessOfficeAuditor; |
| 125 | 143 | |
| 126 | 144 | /** |
| 145 | + * 经营办审核人名称 | |
| 146 | + */ | |
| 147 | + @ApiModelProperty("经营办审核人名称") | |
| 148 | + private String businessOfficeAuditorName; | |
| 149 | + | |
| 150 | + /** | |
| 127 | 151 | * 运作科审核人 |
| 128 | 152 | */ |
| 129 | 153 | @ApiModelProperty("运作科审核人") |
| 130 | 154 | private String operationsDepartmentAuditor; |
| 131 | 155 | |
| 156 | + /** | |
| 157 | + * 运作科审核人名称 | |
| 158 | + */ | |
| 159 | + @ApiModelProperty("运作科审核人名称") | |
| 160 | + private String operationsDepartmentAuditorName; | |
| 161 | + | |
| 162 | + /** | |
| 163 | + * 审核状态 | |
| 164 | + */ | |
| 165 | + @ApiModelProperty("审核状态") | |
| 166 | + private String status; | |
| 167 | + | |
| 132 | 168 | public GetRequestCarTicketBo() { |
| 133 | 169 | |
| 134 | 170 | } | ... | ... |
| ... | ... | @@ -85,7 +85,7 @@ public class RequestCarTicketController extends DefaultBaseController { |
| 85 | 85 | @ApiOperation("新增") |
| 86 | 86 | @HasPermission({"requestCarTicket:requestcarticket:add"}) |
| 87 | 87 | @PostMapping |
| 88 | - public InvokeResult<Void> create(@Valid CreateRequestCarTicketVo vo) { | |
| 88 | + public InvokeResult<Void> create(@Valid @RequestBody CreateRequestCarTicketVo vo) { | |
| 89 | 89 | |
| 90 | 90 | requestCarTicketService.create(vo); |
| 91 | 91 | |
| ... | ... | @@ -98,7 +98,7 @@ public class RequestCarTicketController extends DefaultBaseController { |
| 98 | 98 | @ApiOperation("修改") |
| 99 | 99 | @HasPermission({"requestCarTicket:requestcarticket:modify"}) |
| 100 | 100 | @PutMapping |
| 101 | - public InvokeResult<Void> update(@Valid UpdateRequestCarTicketVo vo) { | |
| 101 | + public InvokeResult<Void> update(@Valid @RequestBody UpdateRequestCarTicketVo vo) { | |
| 102 | 102 | |
| 103 | 103 | requestCarTicketService.update(vo); |
| 104 | 104 | |
| ... | ... | @@ -106,6 +106,19 @@ public class RequestCarTicketController extends DefaultBaseController { |
| 106 | 106 | } |
| 107 | 107 | |
| 108 | 108 | /** |
| 109 | + * 取消 | |
| 110 | + */ | |
| 111 | + @ApiOperation("取消") | |
| 112 | + @HasPermission({"purchaseOrderRevoke:purchaseorderrevoke:cancel"}) | |
| 113 | + @GetMapping("/cancel") | |
| 114 | + public InvokeResult<Void> cancel(@NotBlank(message = "id不能为空!") String id) { | |
| 115 | + | |
| 116 | + requestCarTicketService.updateStatus(id, "CANCEL"); | |
| 117 | + | |
| 118 | + return InvokeResultBuilder.success(); | |
| 119 | + } | |
| 120 | + | |
| 121 | + /** | |
| 109 | 122 | * 根据ID删除 |
| 110 | 123 | */ |
| 111 | 124 | @ApiOperation("根据ID删除") | ... | ... |
| ... | ... | @@ -40,6 +40,12 @@ public class RequestCarTicket extends BaseEntity implements BaseDto { |
| 40 | 40 | private String deptId; |
| 41 | 41 | |
| 42 | 42 | /** |
| 43 | + * 要车办事处名称(非持久化字段) | |
| 44 | + */ | |
| 45 | + @TableField(exist = false) | |
| 46 | + private String deptName; | |
| 47 | + | |
| 48 | + /** | |
| 43 | 49 | * 计划装货日期 |
| 44 | 50 | */ |
| 45 | 51 | private LocalDate deliveryDate; |
| ... | ... | @@ -50,6 +56,12 @@ public class RequestCarTicket extends BaseEntity implements BaseDto { |
| 50 | 56 | private String workshopId; |
| 51 | 57 | |
| 52 | 58 | /** |
| 59 | + * 装货厂别名称(非持久化字段) | |
| 60 | + */ | |
| 61 | + @TableField(exist = false) | |
| 62 | + private String workshopName; | |
| 63 | + | |
| 64 | + /** | |
| 53 | 65 | * 订单编号 |
| 54 | 66 | */ |
| 55 | 67 | private String orderNo; |
| ... | ... | @@ -95,6 +107,12 @@ public class RequestCarTicket extends BaseEntity implements BaseDto { |
| 95 | 107 | private String externalAuditor; |
| 96 | 108 | |
| 97 | 109 | /** |
| 110 | + * 外办审核人名称(非持久化字段) | |
| 111 | + */ | |
| 112 | + @TableField(exist = false) | |
| 113 | + private String externalAuditorName; | |
| 114 | + | |
| 115 | + /** | |
| 98 | 116 | * 装货时间 |
| 99 | 117 | */ |
| 100 | 118 | private String loadingTime; |
| ... | ... | @@ -110,11 +128,28 @@ public class RequestCarTicket extends BaseEntity implements BaseDto { |
| 110 | 128 | private String businessOfficeAuditor; |
| 111 | 129 | |
| 112 | 130 | /** |
| 131 | + * 经营办审核人名称(非持久化字段) | |
| 132 | + */ | |
| 133 | + @TableField(exist = false) | |
| 134 | + private String businessOfficeAuditorName; | |
| 135 | + | |
| 136 | + /** | |
| 113 | 137 | * 运作科审核人 |
| 114 | 138 | */ |
| 115 | 139 | private String operationsDepartmentAuditor; |
| 116 | 140 | |
| 117 | 141 | /** |
| 142 | + * 运作科审核人名称(非持久化字段) | |
| 143 | + */ | |
| 144 | + @TableField(exist = false) | |
| 145 | + private String operationsDepartmentAuditorName; | |
| 146 | + | |
| 147 | + /** | |
| 148 | + * 审核状态 | |
| 149 | + */ | |
| 150 | + private String status; | |
| 151 | + | |
| 152 | + /** | |
| 118 | 153 | * 创建人ID |
| 119 | 154 | */ |
| 120 | 155 | @TableField(fill = FieldFill.INSERT) | ... | ... |
| ... | ... | @@ -22,6 +22,7 @@ import com.lframework.xingyun.sc.service.shipments.car.RequestCarTicketService; |
| 22 | 22 | import com.lframework.xingyun.sc.vo.shipments.car.CreateRequestCarTicketVo; |
| 23 | 23 | import com.lframework.xingyun.sc.vo.shipments.car.QueryRequestCarTicketVo; |
| 24 | 24 | import com.lframework.xingyun.sc.vo.shipments.car.UpdateRequestCarTicketVo; |
| 25 | +import org.apache.commons.lang3.StringUtils; | |
| 25 | 26 | import org.springframework.transaction.annotation.Transactional; |
| 26 | 27 | import org.springframework.stereotype.Service; |
| 27 | 28 | |
| ... | ... | @@ -51,7 +52,7 @@ public class RequestCarTicketServiceImpl extends BaseMpServiceImpl<RequestCarTic |
| 51 | 52 | @Override |
| 52 | 53 | public RequestCarTicket findById(String id) { |
| 53 | 54 | |
| 54 | - return getBaseMapper().selectById(id); | |
| 55 | + return getBaseMapper().findById(id); | |
| 55 | 56 | } |
| 56 | 57 | |
| 57 | 58 | @OpLog(type = OtherOpLogType.class, name = "新增要车单表,ID:{}", params = {"#id"}) |
| ... | ... | @@ -112,6 +113,9 @@ public class RequestCarTicketServiceImpl extends BaseMpServiceImpl<RequestCarTic |
| 112 | 113 | if (!StringUtil.isBlank(vo.getOperationsDepartmentAuditor())) { |
| 113 | 114 | data.setOperationsDepartmentAuditor(vo.getOperationsDepartmentAuditor()); |
| 114 | 115 | } |
| 116 | + if (!StringUtil.isBlank(vo.getStatus())) { | |
| 117 | + data.setStatus(vo.getStatus()); | |
| 118 | + } | |
| 115 | 119 | |
| 116 | 120 | getBaseMapper().insert(data); |
| 117 | 121 | |
| ... | ... | @@ -149,6 +153,7 @@ public class RequestCarTicketServiceImpl extends BaseMpServiceImpl<RequestCarTic |
| 149 | 153 | .set(RequestCarTicket::getSpecialLoadingRequirement, StringUtil.isBlank(vo.getSpecialLoadingRequirement()) ? null : vo.getSpecialLoadingRequirement()) |
| 150 | 154 | .set(RequestCarTicket::getBusinessOfficeAuditor, StringUtil.isBlank(vo.getBusinessOfficeAuditor()) ? null : vo.getBusinessOfficeAuditor()) |
| 151 | 155 | .set(RequestCarTicket::getOperationsDepartmentAuditor, StringUtil.isBlank(vo.getOperationsDepartmentAuditor()) ? null : vo.getOperationsDepartmentAuditor()) |
| 156 | + .set(RequestCarTicket::getStatus, StringUtil.isBlank(vo.getStatus()) ? null : vo.getStatus()) | |
| 152 | 157 | .eq(RequestCarTicket::getId, vo.getId()); |
| 153 | 158 | |
| 154 | 159 | getBaseMapper().update(updateWrapper); |
| ... | ... | @@ -157,6 +162,27 @@ public class RequestCarTicketServiceImpl extends BaseMpServiceImpl<RequestCarTic |
| 157 | 162 | OpLogUtil.setExtra(vo); |
| 158 | 163 | } |
| 159 | 164 | |
| 165 | + @OpLog(type = OtherOpLogType.class, name = "修改草稿要车单状态,ID:{}", params = {"#id"}) | |
| 166 | + @Transactional(rollbackFor = Exception.class) | |
| 167 | + @Override | |
| 168 | + public void updateStatus(String id, String status) { | |
| 169 | + if (StringUtils.isBlank(id) || StringUtils.isBlank(status)) { | |
| 170 | + return; | |
| 171 | + } | |
| 172 | + RequestCarTicket data = getBaseMapper().findById(id); | |
| 173 | + if (ObjectUtil.isNull(data)) { | |
| 174 | + throw new DefaultClientException("草稿要车单不存在!"); | |
| 175 | + } | |
| 176 | + LambdaUpdateWrapper<RequestCarTicket> updateWrapper = Wrappers.lambdaUpdate(RequestCarTicket.class) | |
| 177 | + .set(RequestCarTicket::getStatus, status) | |
| 178 | + .eq(RequestCarTicket::getId, id); | |
| 179 | + | |
| 180 | + getBaseMapper().update(updateWrapper); | |
| 181 | + | |
| 182 | + OpLogUtil.setVariable("id", data.getId()); | |
| 183 | + OpLogUtil.setExtra(id); | |
| 184 | + } | |
| 185 | + | |
| 160 | 186 | @OpLog(type = OtherOpLogType.class, name = "删除要车单表,ID:{}", params = {"#id"}) |
| 161 | 187 | @Transactional(rollbackFor = Exception.class) |
| 162 | 188 | @Override | ... | ... |
| ... | ... | @@ -21,4 +21,13 @@ public interface RequestCarTicketMapper extends BaseMapper<RequestCarTicket> { |
| 21 | 21 | * @return |
| 22 | 22 | */ |
| 23 | 23 | List<RequestCarTicket> query(@Param("vo") QueryRequestCarTicketVo vo); |
| 24 | + | |
| 25 | + | |
| 26 | + /** | |
| 27 | + * 草稿要车单 | |
| 28 | + * | |
| 29 | + * @param id 主键 | |
| 30 | + * @return RequestCarTicket | |
| 31 | + */ | |
| 32 | + RequestCarTicket findById(@Param("id") String id); | |
| 24 | 33 | } | ... | ... |
| ... | ... | @@ -47,6 +47,14 @@ public interface RequestCarTicketService extends BaseMpService<RequestCarTicket> |
| 47 | 47 | void update(UpdateRequestCarTicketVo vo); |
| 48 | 48 | |
| 49 | 49 | /** |
| 50 | + * 修改状态 | |
| 51 | + * | |
| 52 | + * @param id 主键 | |
| 53 | + * @param status 状态 | |
| 54 | + */ | |
| 55 | + void updateStatus(String id, String status); | |
| 56 | + | |
| 57 | + /** | |
| 50 | 58 | * 根据ID删除 |
| 51 | 59 | * @param id |
| 52 | 60 | * @return | ... | ... |
| ... | ... | @@ -135,4 +135,10 @@ public class CreateRequestCarTicketVo implements BaseVo, Serializable { |
| 135 | 135 | @Length(message = "运作科审核人最多允许50个字符!") |
| 136 | 136 | private String operationsDepartmentAuditor; |
| 137 | 137 | |
| 138 | + /** | |
| 139 | + * 审核状态 | |
| 140 | + */ | |
| 141 | + @ApiModelProperty("审核状态") | |
| 142 | + private String status; | |
| 143 | + | |
| 138 | 144 | } | ... | ... |
| ... | ... | @@ -2,9 +2,7 @@ package com.lframework.xingyun.sc.vo.shipments.car; |
| 2 | 2 | |
| 3 | 3 | import lombok.Data; |
| 4 | 4 | import com.lframework.starter.web.core.vo.PageVo; |
| 5 | -import java.time.LocalDate; | |
| 6 | 5 | import com.lframework.starter.web.core.vo.BaseVo; |
| 7 | -import com.lframework.starter.web.core.components.validation.TypeMismatch; | |
| 8 | 6 | import io.swagger.annotations.ApiModelProperty; |
| 9 | 7 | import java.io.Serializable; |
| 10 | 8 | |
| ... | ... | @@ -14,11 +12,22 @@ public class QueryRequestCarTicketVo extends PageVo implements BaseVo, Serializa |
| 14 | 12 | private static final long serialVersionUID = 1L; |
| 15 | 13 | |
| 16 | 14 | /** |
| 17 | - * 要车日期 | |
| 15 | + * 要车办事处名称 | |
| 18 | 16 | */ |
| 19 | - @ApiModelProperty("要车日期") | |
| 20 | - @TypeMismatch(message = "要车日期格式有误!") | |
| 21 | - private LocalDate requestCarData; | |
| 17 | + @ApiModelProperty("要车办事处名称") | |
| 18 | + private String deptName; | |
| 19 | + | |
| 20 | + /** | |
| 21 | + * 要车日期开始 | |
| 22 | + */ | |
| 23 | + @ApiModelProperty("要车日期开始") | |
| 24 | + private String requestCarDataStart; | |
| 25 | + | |
| 26 | + /** | |
| 27 | + * 要车日期结束 | |
| 28 | + */ | |
| 29 | + @ApiModelProperty("要车日期结束") | |
| 30 | + private String requestCarDataEnd; | |
| 22 | 31 | |
| 23 | 32 | /** |
| 24 | 33 | * 装货厂别 |
| ... | ... | @@ -38,4 +47,11 @@ public class QueryRequestCarTicketVo extends PageVo implements BaseVo, Serializa |
| 38 | 47 | @ApiModelProperty("客户名称【简称】") |
| 39 | 48 | private String customerShortName; |
| 40 | 49 | |
| 50 | + | |
| 51 | + /** | |
| 52 | + * 状态 | |
| 53 | + */ | |
| 54 | + @ApiModelProperty("状态") | |
| 55 | + private String status; | |
| 56 | + | |
| 41 | 57 | } | ... | ... |
| ... | ... | @@ -143,4 +143,10 @@ public class UpdateRequestCarTicketVo implements BaseVo, Serializable { |
| 143 | 143 | @Length(message = "运作科审核人最多允许50个字符!") |
| 144 | 144 | private String operationsDepartmentAuditor; |
| 145 | 145 | |
| 146 | + /** | |
| 147 | + * 审核状态 | |
| 148 | + */ | |
| 149 | + @ApiModelProperty("审核状态") | |
| 150 | + private String status; | |
| 151 | + | |
| 146 | 152 | } | ... | ... |
| ... | ... | @@ -6,8 +6,10 @@ |
| 6 | 6 | <id column="id" property="id"/> |
| 7 | 7 | <result column="request_car_data" property="requestCarData"/> |
| 8 | 8 | <result column="dept_id" property="deptId"/> |
| 9 | + <result column="dept_name" property="deptName"/> | |
| 9 | 10 | <result column="delivery_date" property="deliveryDate"/> |
| 10 | 11 | <result column="workshop_id" property="workshopId"/> |
| 12 | + <result column="workshop_name" property="workshopName"/> | |
| 11 | 13 | <result column="order_no" property="orderNo"/> |
| 12 | 14 | <result column="customer_short_name" property="customerShortName"/> |
| 13 | 15 | <result column="destination" property="destination"/> |
| ... | ... | @@ -17,10 +19,14 @@ |
| 17 | 19 | <result column="return_plan_arrangement" property="returnPlanArrangement"/> |
| 18 | 20 | <result column="other" property="other"/> |
| 19 | 21 | <result column="external_auditor" property="externalAuditor"/> |
| 22 | + <result column="external_auditor_name" property="externalAuditorName"/> | |
| 20 | 23 | <result column="loading_time" property="loadingTime"/> |
| 21 | 24 | <result column="special_loading_requirement" property="specialLoadingRequirement"/> |
| 22 | 25 | <result column="business_office_auditor" property="businessOfficeAuditor"/> |
| 26 | + <result column="business_office_auditor_name" property="businessOfficeAuditorName"/> | |
| 23 | 27 | <result column="operations_department_auditor" property="operationsDepartmentAuditor"/> |
| 28 | + <result column="operations_department_auditor_name" property="operationsDepartmentAuditorName"/> | |
| 29 | + <result column="status" property="status"/> | |
| 24 | 30 | <result column="create_by_id" property="createById"/> |
| 25 | 31 | <result column="create_by" property="createBy"/> |
| 26 | 32 | <result column="update_by_id" property="updateById"/> |
| ... | ... | @@ -34,8 +40,10 @@ |
| 34 | 40 | tb.id, |
| 35 | 41 | tb.request_car_data, |
| 36 | 42 | tb.dept_id, |
| 43 | + sd.name AS dept_name, | |
| 37 | 44 | tb.delivery_date, |
| 38 | 45 | tb.workshop_id, |
| 46 | + ws.name AS workshop_name, | |
| 39 | 47 | tb.order_no, |
| 40 | 48 | tb.customer_short_name, |
| 41 | 49 | tb.destination, |
| ... | ... | @@ -45,10 +53,14 @@ |
| 45 | 53 | tb.return_plan_arrangement, |
| 46 | 54 | tb.other, |
| 47 | 55 | tb.external_auditor, |
| 56 | + su.name AS external_auditor_name, | |
| 48 | 57 | tb.loading_time, |
| 49 | 58 | tb.special_loading_requirement, |
| 50 | 59 | tb.business_office_auditor, |
| 60 | + su1.name AS business_office_auditor_name, | |
| 51 | 61 | tb.operations_department_auditor, |
| 62 | + su2.name AS operations_department_auditor_name, | |
| 63 | + tb.status, | |
| 52 | 64 | tb.create_by_id, |
| 53 | 65 | tb.create_by, |
| 54 | 66 | tb.update_by_id, |
| ... | ... | @@ -56,24 +68,49 @@ |
| 56 | 68 | tb.create_time, |
| 57 | 69 | tb.update_time |
| 58 | 70 | FROM request_car_ticket AS tb |
| 71 | + left join sys_dept as sd on sd.id = tb.dept_id | |
| 72 | + left join base_data_workshop as ws on ws.id = tb.workshop_id | |
| 73 | + left join sys_user as su on su.id = tb.external_auditor | |
| 74 | + left join sys_user as su1 on su1.id = tb.business_office_auditor | |
| 75 | + left join sys_user as su2 on su2.id = tb.operations_department_auditor | |
| 59 | 76 | </sql> |
| 60 | 77 | |
| 61 | 78 | <select id="query" resultMap="RequestCarTicket"> |
| 62 | 79 | <include refid="RequestCarTicket_sql"/> |
| 63 | 80 | <where> |
| 64 | - <if test="vo.requestCarData != null"> | |
| 65 | - AND tb.request_car_data = #{vo.requestCarData} | |
| 81 | + <if test="vo.requestCarDataStart != null"> | |
| 82 | + AND tb.request_car_data >= #{vo.requestCarDataStart} | |
| 83 | + </if> | |
| 84 | + <if test="vo.requestCarDataEnd != null"> | |
| 85 | + <![CDATA[ | |
| 86 | + AND tb.request_car_data <= #{vo.requestCarDataEnd} | |
| 87 | + ]]> | |
| 66 | 88 | </if> |
| 67 | 89 | <if test="vo.workshopId != null and vo.workshopId != ''"> |
| 68 | 90 | AND tb.workshop_id = #{vo.workshopId} |
| 69 | 91 | </if> |
| 70 | 92 | <if test="vo.orderNo != null and vo.orderNo != ''"> |
| 71 | - AND tb.order_no = #{vo.orderNo} | |
| 93 | + AND tb.order_no LIKE CONCAT('%', #{vo.orderNo},'%') | |
| 72 | 94 | </if> |
| 73 | 95 | <if test="vo.customerShortName != null and vo.customerShortName != ''"> |
| 74 | - AND tb.customer_short_name LIKE CONCAT('%', #{vo.customerShortName}) | |
| 96 | + AND tb.customer_short_name LIKE CONCAT('%', #{vo.customerShortName},'%') | |
| 97 | + </if> | |
| 98 | + <if test="vo.deptName != null and vo.deptName != ''"> | |
| 99 | + AND sd.name LIKE CONCAT('%', #{vo.deptName},'%') | |
| 100 | + </if> | |
| 101 | + <if test="vo.status != null and vo.status != ''"> | |
| 102 | + AND tb.status = #{vo.status} | |
| 75 | 103 | </if> |
| 76 | 104 | </where> |
| 77 | 105 | ORDER BY tb.update_time DESC |
| 78 | 106 | </select> |
| 107 | + | |
| 108 | + <select id="findById" resultType="com.lframework.xingyun.sc.entity.RequestCarTicket"> | |
| 109 | + <include refid="RequestCarTicket_sql"/> | |
| 110 | + <where> | |
| 111 | + <if test="id != null and id != ''"> | |
| 112 | + AND tb.id = #{id} | |
| 113 | + </if> | |
| 114 | + </where> | |
| 115 | + </select> | |
| 79 | 116 | </mapper> | ... | ... |