Showing
10 changed files
with
179 additions
and
4 deletions
| ... | ... | @@ -4,6 +4,8 @@ import com.baomidou.mybatisplus.annotation.TableField; |
| 4 | 4 | import com.fasterxml.jackson.annotation.JsonFormat; |
| 5 | 5 | import com.lframework.starter.common.constants.StringPool; |
| 6 | 6 | import com.lframework.starter.web.core.bo.BaseBo; |
| 7 | + | |
| 8 | +import java.math.BigDecimal; | |
| 7 | 9 | import java.time.LocalDate; |
| 8 | 10 | import java.util.List; |
| 9 | 11 | |
| ... | ... | @@ -47,6 +49,12 @@ public class GetPurchaseOrderInfoBo extends BaseBo<PurchaseOrderInfo> { |
| 47 | 49 | private String orderingUnit; |
| 48 | 50 | |
| 49 | 51 | /** |
| 52 | + * 订货单位名称 | |
| 53 | + */ | |
| 54 | + @ApiModelProperty("订货单位名称") | |
| 55 | + private String orderingUnitName; | |
| 56 | + | |
| 57 | + /** | |
| 50 | 58 | * 订货日期 |
| 51 | 59 | */ |
| 52 | 60 | @ApiModelProperty("订货日期") |
| ... | ... | @@ -228,6 +236,29 @@ public class GetPurchaseOrderInfoBo extends BaseBo<PurchaseOrderInfo> { |
| 228 | 236 | @ApiModelProperty("订货单类型") |
| 229 | 237 | private String type; |
| 230 | 238 | |
| 239 | + /** | |
| 240 | + * 总数量 | |
| 241 | + */ | |
| 242 | + @ApiModelProperty("总数量") | |
| 243 | + private BigDecimal totalQuantity; | |
| 244 | + | |
| 245 | + /** | |
| 246 | + * 包装费 | |
| 247 | + */ | |
| 248 | + @ApiModelProperty("包装费") | |
| 249 | + private BigDecimal packagingFee; | |
| 250 | + | |
| 251 | + /** | |
| 252 | + * 是否为合同创建人 | |
| 253 | + */ | |
| 254 | + @ApiModelProperty("是否为合同创建人") | |
| 255 | + private boolean contractCreateBy; | |
| 256 | + | |
| 257 | + /** | |
| 258 | + * 是否展示审核按钮(非持久化字段) | |
| 259 | + */ | |
| 260 | + @TableField(exist = false) | |
| 261 | + private Boolean showExamine; | |
| 231 | 262 | |
| 232 | 263 | |
| 233 | 264 | public GetPurchaseOrderInfoBo() { | ... | ... |
xingyun-sc/src/main/java/com/lframework/xingyun/sc/controller/order/PurchaseOrderInfoController.java
| ... | ... | @@ -3,6 +3,9 @@ package com.lframework.xingyun.sc.controller.order; |
| 3 | 3 | import cn.hutool.core.io.resource.ClassPathResource; |
| 4 | 4 | import com.baomidou.mybatisplus.core.conditions.Wrapper; |
| 5 | 5 | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| 6 | +import com.lframework.starter.bpm.dto.FlowTaskDto; | |
| 7 | +import com.lframework.starter.bpm.mappers.FlowTaskWrapperMapper; | |
| 8 | +import com.lframework.starter.bpm.vo.flow.task.QueryTodoTaskListVo; | |
| 6 | 9 | import com.lframework.starter.common.exceptions.impl.DefaultClientException; |
| 7 | 10 | import com.lframework.starter.common.utils.CollectionUtil; |
| 8 | 11 | import com.lframework.starter.web.core.annotations.security.HasPermission; |
| ... | ... | @@ -85,6 +88,8 @@ public class PurchaseOrderInfoController extends DefaultBaseController { |
| 85 | 88 | private SysUserDeptService sysUserDeptService; |
| 86 | 89 | @Resource |
| 87 | 90 | private SysDeptService sysDeptService; |
| 91 | + @Resource | |
| 92 | + private FlowTaskWrapperMapper flowTaskWrapperMapper; | |
| 88 | 93 | |
| 89 | 94 | |
| 90 | 95 | /** |
| ... | ... | @@ -101,7 +106,18 @@ public class PurchaseOrderInfoController extends DefaultBaseController { |
| 101 | 106 | List<GetPurchaseOrderInfoBo> results = null; |
| 102 | 107 | |
| 103 | 108 | if (!CollectionUtil.isEmpty(datas)) { |
| 104 | - results = datas.stream().map(GetPurchaseOrderInfoBo::new).collect(Collectors.toList()); | |
| 109 | + String currentUserId = SecurityUtil.getCurrentUser().getId(); | |
| 110 | + | |
| 111 | + results = datas.stream().map(purchaseOrderInfo -> { | |
| 112 | + GetPurchaseOrderInfoBo bo = new GetPurchaseOrderInfoBo(purchaseOrderInfo); | |
| 113 | + // 判断 contractCreateById 是否等于当前用户 ID | |
| 114 | + boolean isCreateBy = false; | |
| 115 | + if (currentUserId.equals(purchaseOrderInfo.getContractCreateById())) { | |
| 116 | + isCreateBy = true; | |
| 117 | + } | |
| 118 | + bo.setContractCreateBy(isCreateBy); | |
| 119 | + return bo; | |
| 120 | + }).collect(Collectors.toList()); | |
| 105 | 121 | } |
| 106 | 122 | |
| 107 | 123 | return InvokeResultBuilder.success(PageResultUtil.rebuild(pageResult, results)); |
| ... | ... | @@ -166,6 +182,12 @@ public class PurchaseOrderInfoController extends DefaultBaseController { |
| 166 | 182 | } |
| 167 | 183 | } |
| 168 | 184 | } |
| 185 | + // 获取当前人员的待办任务数据 | |
| 186 | + List<FlowTaskDto> flowTaskList = flowTaskWrapperMapper.queryTodoList(new QueryTodoTaskListVo(), SecurityUtil.getCurrentUser().getId()); | |
| 187 | + if (org.apache.commons.collections.CollectionUtils.isNotEmpty(flowTaskList)) { | |
| 188 | + List<String> businessIds = flowTaskList.stream().map(FlowTaskDto::getBusinessId).collect(Collectors.toList()); | |
| 189 | + result.setShowExamine(businessIds.contains(result.getId())); | |
| 190 | + } | |
| 169 | 191 | result.setPurchaseOrderLineList(purchaseOrderLineList); |
| 170 | 192 | } |
| 171 | 193 | |
| ... | ... | @@ -200,6 +222,20 @@ public class PurchaseOrderInfoController extends DefaultBaseController { |
| 200 | 222 | } |
| 201 | 223 | |
| 202 | 224 | /** |
| 225 | + * 取消 | |
| 226 | + */ | |
| 227 | + @ApiOperation("取消") | |
| 228 | + @HasPermission({"purchaseOrderRevoke:purchaseorderrevoke:cancel"}) | |
| 229 | + @GetMapping("/cancel") | |
| 230 | + public InvokeResult<Void> cancel(@NotBlank(message = "id不能为空!") String id, | |
| 231 | + @NotBlank(message = "status不能为空!") String status) { | |
| 232 | + | |
| 233 | + purchaseOrderInfoService.updateStatus(id, status); | |
| 234 | + | |
| 235 | + return InvokeResultBuilder.success(); | |
| 236 | + } | |
| 237 | + | |
| 238 | + /** | |
| 203 | 239 | * 根据ID删除 |
| 204 | 240 | */ |
| 205 | 241 | @ApiOperation("根据ID删除") | ... | ... |
| ... | ... | @@ -2,12 +2,12 @@ package com.lframework.xingyun.sc.entity; |
| 2 | 2 | |
| 3 | 3 | import com.baomidou.mybatisplus.annotation.TableName; |
| 4 | 4 | import com.lframework.starter.web.core.dto.BaseDto; |
| 5 | +import java.math.BigDecimal; | |
| 5 | 6 | import java.time.LocalDate; |
| 6 | 7 | import java.time.LocalDateTime; |
| 7 | 8 | import com.baomidou.mybatisplus.annotation.FieldFill; |
| 8 | 9 | import com.lframework.starter.web.core.entity.BaseEntity; |
| 9 | 10 | import com.baomidou.mybatisplus.annotation.TableField; |
| 10 | -import io.swagger.annotations.ApiModelProperty; | |
| 11 | 11 | import lombok.Data; |
| 12 | 12 | |
| 13 | 13 | /** |
| ... | ... | @@ -185,6 +185,28 @@ public class PurchaseOrderInfo extends BaseEntity implements BaseDto { |
| 185 | 185 | private String type; |
| 186 | 186 | |
| 187 | 187 | /** |
| 188 | + * 总数量 | |
| 189 | + */ | |
| 190 | + private BigDecimal totalQuantity; | |
| 191 | + | |
| 192 | + /** | |
| 193 | + * 包装费 | |
| 194 | + */ | |
| 195 | + private BigDecimal packagingFee; | |
| 196 | + | |
| 197 | + /** | |
| 198 | + * 合同创建人ID | |
| 199 | + */ | |
| 200 | + private String contractCreateById; | |
| 201 | + | |
| 202 | + | |
| 203 | + /** | |
| 204 | + * 是否展示审核按钮(非持久化字段) | |
| 205 | + */ | |
| 206 | + @TableField(exist = false) | |
| 207 | + private Boolean showExamine; | |
| 208 | + | |
| 209 | + /** | |
| 188 | 210 | * 创建人ID |
| 189 | 211 | */ |
| 190 | 212 | @TableField(fill = FieldFill.INSERT) | ... | ... |
| ... | ... | @@ -257,8 +257,8 @@ public class BusinessDataHandlerServiceImpl implements BusinessDataHandlerServic |
| 257 | 257 | //发起人 |
| 258 | 258 | String createById = revoke.getCreateById(); |
| 259 | 259 | userIdList.add(createById); |
| 260 | - //综合内勤 | |
| 261 | - List<String> list1 = transactorHandler.listTransactorsByRoleCode("zhnq", createById); | |
| 260 | + //综合内勤=办事处内勤 | |
| 261 | + List<String> list1 = transactorHandler.listTransactorsByRoleCode("bscnq", createById); | |
| 262 | 262 | if (CollectionUtils.isNotEmpty(list1)) { |
| 263 | 263 | userIdList.addAll(list1); |
| 264 | 264 | } | ... | ... |
| ... | ... | @@ -3,7 +3,11 @@ package com.lframework.xingyun.sc.impl.order; |
| 3 | 3 | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| 4 | 4 | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| 5 | 5 | import com.github.pagehelper.PageInfo; |
| 6 | +import com.lframework.starter.bpm.dto.FlowTaskDto; | |
| 7 | +import com.lframework.starter.bpm.mappers.FlowTaskWrapperMapper; | |
| 6 | 8 | import com.lframework.starter.bpm.service.FlowInstanceWrapperService; |
| 9 | +import com.lframework.starter.bpm.vo.flow.task.QueryTodoTaskListVo; | |
| 10 | +import com.lframework.starter.web.core.components.security.SecurityUtil; | |
| 7 | 11 | import com.lframework.starter.web.core.impl.BaseMpServiceImpl; |
| 8 | 12 | import com.lframework.starter.web.core.utils.PageResultUtil; |
| 9 | 13 | import com.lframework.starter.web.core.components.resp.PageResult; |
| ... | ... | @@ -33,6 +37,7 @@ import org.springframework.stereotype.Service; |
| 33 | 37 | |
| 34 | 38 | import javax.annotation.Resource; |
| 35 | 39 | import java.util.List; |
| 40 | +import java.util.stream.Collectors; | |
| 36 | 41 | |
| 37 | 42 | @Service |
| 38 | 43 | public class PurchaseOrderInfoServiceImpl extends BaseMpServiceImpl<PurchaseOrderInfoMapper, PurchaseOrderInfo> implements PurchaseOrderInfoService { |
| ... | ... | @@ -44,6 +49,8 @@ public class PurchaseOrderInfoServiceImpl extends BaseMpServiceImpl<PurchaseOrde |
| 44 | 49 | private CustomerCreditService customerCreditService; |
| 45 | 50 | @Resource |
| 46 | 51 | private FlowInstanceWrapperService flowInstanceWrapperService; |
| 52 | + @Resource | |
| 53 | + private FlowTaskWrapperMapper flowTaskWrapperMapper; | |
| 47 | 54 | |
| 48 | 55 | @Override |
| 49 | 56 | public PageResult<PurchaseOrderInfo> query(Integer pageIndex, Integer pageSize, QueryPurchaseOrderInfoVo vo) { |
| ... | ... | @@ -53,6 +60,21 @@ public class PurchaseOrderInfoServiceImpl extends BaseMpServiceImpl<PurchaseOrde |
| 53 | 60 | |
| 54 | 61 | PageHelperUtil.startPage(pageIndex, pageSize); |
| 55 | 62 | List<PurchaseOrderInfo> datas = this.query(vo); |
| 63 | + if (CollectionUtils.isNotEmpty(datas)) { | |
| 64 | + // 获取当前人员的待办任务数据 | |
| 65 | + List<FlowTaskDto> flowTaskList = flowTaskWrapperMapper.queryTodoList(new QueryTodoTaskListVo(), SecurityUtil.getCurrentUser().getId()); | |
| 66 | + if (org.apache.commons.collections4.CollectionUtils.isEmpty(flowTaskList)) { | |
| 67 | + return new PageResult<>(); | |
| 68 | + } | |
| 69 | + List<String> ids = flowTaskList.stream().map(FlowTaskDto::getBusinessId).collect(Collectors.toList()); | |
| 70 | + for (PurchaseOrderInfo purchaseOrderInfo : datas) { | |
| 71 | + if (ids.contains(purchaseOrderInfo.getId())) { | |
| 72 | + purchaseOrderInfo.setShowExamine(true); | |
| 73 | + } else { | |
| 74 | + purchaseOrderInfo.setShowExamine(false); | |
| 75 | + } | |
| 76 | + } | |
| 77 | + } | |
| 56 | 78 | |
| 57 | 79 | return PageResultUtil.convert(new PageInfo<>(datas)); |
| 58 | 80 | } |
| ... | ... | @@ -172,6 +194,16 @@ public class PurchaseOrderInfoServiceImpl extends BaseMpServiceImpl<PurchaseOrde |
| 172 | 194 | if (!StringUtil.isBlank(vo.getType())) { |
| 173 | 195 | data.setType(vo.getType()); |
| 174 | 196 | } |
| 197 | + if (vo.getTotalQuantity() != null) { | |
| 198 | + data.setTotalQuantity(vo.getTotalQuantity()); | |
| 199 | + } | |
| 200 | + if (vo.getPackagingFee() != null) { | |
| 201 | + data.setPackagingFee(vo.getPackagingFee()); | |
| 202 | + } | |
| 203 | + if (!StringUtil.isBlank(vo.getContractCreateById())) { | |
| 204 | + data.setContractCreateById(vo.getContractCreateById()); | |
| 205 | + } | |
| 206 | + | |
| 175 | 207 | |
| 176 | 208 | getBaseMapper().insert(data); |
| 177 | 209 | |
| ... | ... | @@ -226,6 +258,8 @@ public class PurchaseOrderInfoServiceImpl extends BaseMpServiceImpl<PurchaseOrde |
| 226 | 258 | .set(PurchaseOrderInfo::getDeptId, StringUtil.isBlank(vo.getDeptId()) ? null : vo.getDeptId()) |
| 227 | 259 | .set(PurchaseOrderInfo::getWorkshopId, StringUtil.isBlank(vo.getWorkshopId()) ? null : vo.getWorkshopId()) |
| 228 | 260 | .set(PurchaseOrderInfo::getCustomerCreditId, StringUtil.isBlank(vo.getCustomerCreditId()) ? null : vo.getCustomerCreditId()) |
| 261 | + .set(PurchaseOrderInfo::getTotalQuantity, vo.getTotalQuantity() == null ? null : vo.getTotalQuantity()) | |
| 262 | + .set(PurchaseOrderInfo::getPackagingFee, vo.getPackagingFee() == null ? null : vo.getPackagingFee()) | |
| 229 | 263 | .eq(PurchaseOrderInfo::getId, vo.getId()); |
| 230 | 264 | |
| 231 | 265 | getBaseMapper().update(updateWrapper); |
| ... | ... | @@ -274,6 +308,7 @@ public class PurchaseOrderInfoServiceImpl extends BaseMpServiceImpl<PurchaseOrde |
| 274 | 308 | .set(PurchaseOrderInfo::getPackaging, StringUtil.isBlank(vo.getPackaging()) ? null : vo.getPackaging()) |
| 275 | 309 | .set(PurchaseOrderInfo::getRemarks, StringUtil.isBlank(vo.getRemarks()) ? null : vo.getRemarks()) |
| 276 | 310 | .set(PurchaseOrderInfo::getProductionProcess, StringUtil.isBlank(vo.getProductionProcess()) ? null : vo.getProductionProcess()) |
| 311 | + .set(PurchaseOrderInfo::getPackagingFee, vo.getPackagingFee() == null ? null : vo.getPackagingFee()) | |
| 277 | 312 | .eq(PurchaseOrderInfo::getId, vo.getId()); |
| 278 | 313 | |
| 279 | 314 | getBaseMapper().update(updateWrapper); | ... | ... |
| ... | ... | @@ -89,6 +89,12 @@ public class QueryCustomerCreditVo extends PageVo implements BaseVo, Serializabl |
| 89 | 89 | private String frozenStatus; |
| 90 | 90 | |
| 91 | 91 | /** |
| 92 | + * 客户分类:AAA、AA、A、BBB、BB、B、C、D | |
| 93 | + */ | |
| 94 | + @ApiModelProperty("客户分类:AAA、AA、A、BBB、BB、B、C、D") | |
| 95 | + private String companySuggestedCategory; | |
| 96 | + | |
| 97 | + /** | |
| 92 | 98 | * 创建时间 |
| 93 | 99 | */ |
| 94 | 100 | @ApiModelProperty(value = "创建时间") | ... | ... |
| 1 | 1 | package com.lframework.xingyun.sc.vo.order; |
| 2 | 2 | |
| 3 | +import java.math.BigDecimal; | |
| 3 | 4 | import java.time.LocalDate; |
| 4 | 5 | import com.lframework.starter.web.core.vo.BaseVo; |
| 5 | 6 | import io.swagger.annotations.ApiModelProperty; |
| ... | ... | @@ -195,4 +196,22 @@ public class CreatePurchaseOrderInfoVo implements BaseVo, Serializable { |
| 195 | 196 | @ApiModelProperty("订货单类型") |
| 196 | 197 | private String type; |
| 197 | 198 | |
| 199 | + /** | |
| 200 | + * 总数量 | |
| 201 | + */ | |
| 202 | + @ApiModelProperty("总数量") | |
| 203 | + private BigDecimal totalQuantity; | |
| 204 | + | |
| 205 | + /** | |
| 206 | + * 包装费 | |
| 207 | + */ | |
| 208 | + @ApiModelProperty("包装费") | |
| 209 | + private BigDecimal packagingFee; | |
| 210 | + | |
| 211 | + /** | |
| 212 | + * 合同创建人ID | |
| 213 | + */ | |
| 214 | + @ApiModelProperty("合同创建人ID") | |
| 215 | + private String contractCreateById; | |
| 216 | + | |
| 198 | 217 | } | ... | ... |
| ... | ... | @@ -2,6 +2,7 @@ package com.lframework.xingyun.sc.vo.order; |
| 2 | 2 | |
| 3 | 3 | import lombok.Data; |
| 4 | 4 | import javax.validation.constraints.NotBlank; |
| 5 | +import java.math.BigDecimal; | |
| 5 | 6 | import java.time.LocalDate; |
| 6 | 7 | import com.lframework.starter.web.core.vo.BaseVo; |
| 7 | 8 | import com.lframework.starter.web.core.components.validation.TypeMismatch; |
| ... | ... | @@ -203,4 +204,16 @@ public class UpdatePurchaseOrderInfoVo implements BaseVo, Serializable { |
| 203 | 204 | @ApiModelProperty("订货单类型") |
| 204 | 205 | private String type; |
| 205 | 206 | |
| 207 | + /** | |
| 208 | + * 总数量 | |
| 209 | + */ | |
| 210 | + @ApiModelProperty("总数量") | |
| 211 | + private BigDecimal totalQuantity; | |
| 212 | + | |
| 213 | + /** | |
| 214 | + * 包装费 | |
| 215 | + */ | |
| 216 | + @ApiModelProperty("包装费") | |
| 217 | + private BigDecimal packagingFee; | |
| 218 | + | |
| 206 | 219 | } | ... | ... |
| ... | ... | @@ -189,6 +189,10 @@ |
| 189 | 189 | <if test="vo.createTimeStr != null and vo.createTimeStr != ''"> |
| 190 | 190 | AND tb.create_time < #{vo.createTimeStr} |
| 191 | 191 | </if> |
| 192 | + <if test="vo.companySuggestedCategory != null and vo.companySuggestedCategory != ''"> | |
| 193 | + AND tb.company_suggested_category = #{vo.companySuggestedCategory} | |
| 194 | + </if> | |
| 195 | + | |
| 192 | 196 | </where> |
| 193 | 197 | </select> |
| 194 | 198 | ... | ... |
| ... | ... | @@ -33,6 +33,9 @@ |
| 33 | 33 | <result column="customer_credit_id" property="customerCreditId"/> |
| 34 | 34 | <result column="customer_tier" property="customerTier"/> |
| 35 | 35 | <result column="type" property="type"/> |
| 36 | + <result column="total_quantity" property="totalQuantity"/> | |
| 37 | + <result column="packaging_fee" property="packagingFee"/> | |
| 38 | + <result column="contract_create_by_id" property="contractCreateById"/> | |
| 36 | 39 | <result column="create_by_id" property="createById"/> |
| 37 | 40 | <result column="create_by" property="createBy"/> |
| 38 | 41 | <result column="update_by_id" property="updateById"/> |
| ... | ... | @@ -73,6 +76,9 @@ |
| 73 | 76 | tb.customer_credit_id, |
| 74 | 77 | cc.company_suggested_category AS customer_tier, |
| 75 | 78 | tb.type, |
| 79 | + tb.total_quantity, | |
| 80 | + tb.packaging_fee, | |
| 81 | + tb.contract_create_by_id, | |
| 76 | 82 | tb.create_by_id, |
| 77 | 83 | tb.create_by, |
| 78 | 84 | tb.update_by_id, |
| ... | ... | @@ -115,6 +121,9 @@ |
| 115 | 121 | <if test="vo.deptId != null and vo.deptId != ''"> |
| 116 | 122 | AND tb.dept_id = #{vo.deptId} |
| 117 | 123 | </if> |
| 124 | + <if test="vo.deptName != null and vo.deptName != ''"> | |
| 125 | + AND sd.name LIKE CONCAT('%', #{vo.deptName},'%') | |
| 126 | + </if> | |
| 118 | 127 | <if test="vo.workshopId != null and vo.workshopId != ''"> |
| 119 | 128 | AND tb.workshop_id = #{vo.workshopId} |
| 120 | 129 | </if> | ... | ... |