Showing
8 changed files
with
144 additions
and
9 deletions
| @@ -1235,6 +1235,8 @@ alter table tbl_purchase_order_line add column contract_distributor_line_id varc | @@ -1235,6 +1235,8 @@ alter table tbl_purchase_order_line add column contract_distributor_line_id varc | ||
| 1235 | 1235 | ||
| 1236 | CREATE TABLE `product_sample_confirmation_slip` ( | 1236 | CREATE TABLE `product_sample_confirmation_slip` ( |
| 1237 | `id` varchar(32) NOT NULL COMMENT 'ID', | 1237 | `id` varchar(32) NOT NULL COMMENT 'ID', |
| 1238 | + `order_id` varchar(32) DEFAULT NULL COMMENT '订货单ID', | ||
| 1239 | + `region` varchar(32) DEFAULT NULL COMMENT '区域', | ||
| 1238 | `ordering_unit` varchar(32) DEFAULT NULL COMMENT '订货单位ID', | 1240 | `ordering_unit` varchar(32) DEFAULT NULL COMMENT '订货单位ID', |
| 1239 | `sample_type` varchar(50) DEFAULT NULL COMMENT '试样种类', | 1241 | `sample_type` varchar(50) DEFAULT NULL COMMENT '试样种类', |
| 1240 | `customer_type` varchar(50) DEFAULT NULL comment '客户类型', | 1242 | `customer_type` varchar(50) DEFAULT NULL comment '客户类型', |
| @@ -3,17 +3,25 @@ package com.lframework.xingyun.sc.bo.sample.confirm; | @@ -3,17 +3,25 @@ package com.lframework.xingyun.sc.bo.sample.confirm; | ||
| 3 | import com.fasterxml.jackson.annotation.JsonFormat; | 3 | import com.fasterxml.jackson.annotation.JsonFormat; |
| 4 | import java.math.BigDecimal; | 4 | import java.math.BigDecimal; |
| 5 | import com.lframework.starter.common.constants.StringPool; | 5 | import com.lframework.starter.common.constants.StringPool; |
| 6 | +import com.lframework.starter.common.utils.StringUtil; | ||
| 6 | import com.lframework.starter.web.core.bo.BaseBo; | 7 | import com.lframework.starter.web.core.bo.BaseBo; |
| 7 | import java.time.LocalDateTime; | 8 | import java.time.LocalDateTime; |
| 8 | import java.util.List; | 9 | import java.util.List; |
| 10 | +import java.util.stream.Collectors; | ||
| 9 | 11 | ||
| 12 | +import com.lframework.starter.web.core.components.security.SecurityUtil; | ||
| 10 | import com.lframework.starter.web.core.utils.ApplicationUtil; | 13 | import com.lframework.starter.web.core.utils.ApplicationUtil; |
| 11 | import com.lframework.starter.web.inner.entity.SysDataDicItem; | 14 | import com.lframework.starter.web.inner.entity.SysDataDicItem; |
| 15 | +import com.lframework.starter.web.inner.entity.SysUserDept; | ||
| 12 | import com.lframework.starter.web.inner.service.system.SysDataDicItemService; | 16 | import com.lframework.starter.web.inner.service.system.SysDataDicItemService; |
| 17 | +import com.lframework.starter.web.inner.service.system.SysUserDeptService; | ||
| 13 | import com.lframework.xingyun.sc.entity.ProductSampleConfirmationSlip; | 18 | import com.lframework.xingyun.sc.entity.ProductSampleConfirmationSlip; |
| 19 | +import com.lframework.xingyun.sc.entity.PurchaseOrderInfo; | ||
| 20 | +import com.lframework.xingyun.sc.service.order.PurchaseOrderInfoService; | ||
| 14 | import io.swagger.annotations.ApiModelProperty; | 21 | import io.swagger.annotations.ApiModelProperty; |
| 15 | 22 | ||
| 16 | import lombok.Data; | 23 | import lombok.Data; |
| 24 | +import org.apache.commons.collections.CollectionUtils; | ||
| 17 | 25 | ||
| 18 | /** | 26 | /** |
| 19 | * <p> | 27 | * <p> |
| @@ -142,7 +150,13 @@ public class GetProductSampleConfirmationSlipBo extends BaseBo<ProductSampleConf | @@ -142,7 +150,13 @@ public class GetProductSampleConfirmationSlipBo extends BaseBo<ProductSampleConf | ||
| 142 | * 是否展示编辑按钮 | 150 | * 是否展示编辑按钮 |
| 143 | */ | 151 | */ |
| 144 | @ApiModelProperty("是否展示编辑按钮") | 152 | @ApiModelProperty("是否展示编辑按钮") |
| 145 | - private String showAudit; | 153 | + private boolean showAudit; |
| 154 | + | ||
| 155 | + /** | ||
| 156 | + * 是否展示审核按钮 | ||
| 157 | + */ | ||
| 158 | + @ApiModelProperty("是否展示审核按钮") | ||
| 159 | + private boolean showExamine; | ||
| 146 | 160 | ||
| 147 | /** | 161 | /** |
| 148 | * 产品试样确认单详情 | 162 | * 产品试样确认单详情 |
| @@ -419,5 +433,18 @@ public class GetProductSampleConfirmationSlipBo extends BaseBo<ProductSampleConf | @@ -419,5 +433,18 @@ public class GetProductSampleConfirmationSlipBo extends BaseBo<ProductSampleConf | ||
| 419 | this.sampleTypeName = dataDicItem == null ? "" : dataDicItem.getName(); | 433 | this.sampleTypeName = dataDicItem == null ? "" : dataDicItem.getName(); |
| 420 | SysDataDicItem dataDicItem1 = sysDataDicItemService.findByCode("ENTERPRISE_TYPE", dto.getCustomerType()); | 434 | SysDataDicItem dataDicItem1 = sysDataDicItemService.findByCode("ENTERPRISE_TYPE", dto.getCustomerType()); |
| 421 | this.customerTypeName = dataDicItem1 == null ? "" : dataDicItem1.getName(); | 435 | this.customerTypeName = dataDicItem1 == null ? "" : dataDicItem1.getName(); |
| 436 | + //判断是否可编辑 | ||
| 437 | + //区域 | ||
| 438 | + String region = dto.getRegion(); | ||
| 439 | + this.showAudit = false; | ||
| 440 | + if (StringUtil.isNotEmpty(region)) { | ||
| 441 | + SysUserDeptService sysUserDeptService = ApplicationUtil.getBean(SysUserDeptService.class); | ||
| 442 | + List<SysUserDept> byDeptId = sysUserDeptService.getByDeptId(region); | ||
| 443 | + if (CollectionUtils.isNotEmpty(byDeptId)) { | ||
| 444 | + List<String> userIds = byDeptId.stream().map(SysUserDept::getUserId).collect(Collectors.toList()); | ||
| 445 | + String userId = SecurityUtil.getCurrentUser().getId(); | ||
| 446 | + this.showAudit = (userIds.contains(userId)); | ||
| 447 | + } | ||
| 448 | + } | ||
| 422 | } | 449 | } |
| 423 | } | 450 | } |
| @@ -3,15 +3,25 @@ package com.lframework.xingyun.sc.bo.sample.confirm; | @@ -3,15 +3,25 @@ package com.lframework.xingyun.sc.bo.sample.confirm; | ||
| 3 | import com.fasterxml.jackson.annotation.JsonFormat; | 3 | import com.fasterxml.jackson.annotation.JsonFormat; |
| 4 | import java.math.BigDecimal; | 4 | import java.math.BigDecimal; |
| 5 | import com.lframework.starter.common.constants.StringPool; | 5 | import com.lframework.starter.common.constants.StringPool; |
| 6 | +import com.lframework.starter.common.utils.StringUtil; | ||
| 6 | import com.lframework.starter.web.core.bo.BaseBo; | 7 | import com.lframework.starter.web.core.bo.BaseBo; |
| 7 | import java.time.LocalDateTime; | 8 | import java.time.LocalDateTime; |
| 9 | +import java.util.List; | ||
| 10 | +import java.util.stream.Collectors; | ||
| 11 | + | ||
| 12 | +import com.lframework.starter.web.core.components.security.SecurityUtil; | ||
| 8 | import com.lframework.starter.web.core.utils.ApplicationUtil; | 13 | import com.lframework.starter.web.core.utils.ApplicationUtil; |
| 9 | import com.lframework.starter.web.inner.entity.SysDataDicItem; | 14 | import com.lframework.starter.web.inner.entity.SysDataDicItem; |
| 15 | +import com.lframework.starter.web.inner.entity.SysUserDept; | ||
| 10 | import com.lframework.starter.web.inner.service.system.SysDataDicItemService; | 16 | import com.lframework.starter.web.inner.service.system.SysDataDicItemService; |
| 17 | +import com.lframework.starter.web.inner.service.system.SysUserDeptService; | ||
| 11 | import com.lframework.xingyun.sc.entity.ProductSampleConfirmationSlip; | 18 | import com.lframework.xingyun.sc.entity.ProductSampleConfirmationSlip; |
| 19 | +import com.lframework.xingyun.sc.entity.PurchaseOrderInfo; | ||
| 20 | +import com.lframework.xingyun.sc.service.order.PurchaseOrderInfoService; | ||
| 12 | import io.swagger.annotations.ApiModelProperty; | 21 | import io.swagger.annotations.ApiModelProperty; |
| 13 | 22 | ||
| 14 | import lombok.Data; | 23 | import lombok.Data; |
| 24 | +import org.apache.commons.collections.CollectionUtils; | ||
| 15 | 25 | ||
| 16 | /** | 26 | /** |
| 17 | * <p> | 27 | * <p> |
| @@ -142,7 +152,13 @@ public class QueryProductSampleConfirmationSlipBo extends BaseBo<ProductSampleCo | @@ -142,7 +152,13 @@ public class QueryProductSampleConfirmationSlipBo extends BaseBo<ProductSampleCo | ||
| 142 | * 是否展示编辑按钮 | 152 | * 是否展示编辑按钮 |
| 143 | */ | 153 | */ |
| 144 | @ApiModelProperty("是否展示编辑按钮") | 154 | @ApiModelProperty("是否展示编辑按钮") |
| 145 | - private String showAudit; | 155 | + private boolean showAudit; |
| 156 | + | ||
| 157 | + /** | ||
| 158 | + * 是否展示审核按钮 | ||
| 159 | + */ | ||
| 160 | + @ApiModelProperty("是否展示审核按钮") | ||
| 161 | + private boolean showExamine; | ||
| 146 | 162 | ||
| 147 | /** | 163 | /** |
| 148 | * 创建人ID | 164 | * 创建人ID |
| @@ -203,5 +219,17 @@ public class QueryProductSampleConfirmationSlipBo extends BaseBo<ProductSampleCo | @@ -203,5 +219,17 @@ public class QueryProductSampleConfirmationSlipBo extends BaseBo<ProductSampleCo | ||
| 203 | this.sampleTypeName = dataDicItem == null ? "" : dataDicItem.getName(); | 219 | this.sampleTypeName = dataDicItem == null ? "" : dataDicItem.getName(); |
| 204 | SysDataDicItem dataDicItem1 = sysDataDicItemService.findByCode("ENTERPRISE_TYPE", dto.getCustomerType()); | 220 | SysDataDicItem dataDicItem1 = sysDataDicItemService.findByCode("ENTERPRISE_TYPE", dto.getCustomerType()); |
| 205 | this.customerTypeName = dataDicItem1 == null ? "" : dataDicItem1.getName(); | 221 | this.customerTypeName = dataDicItem1 == null ? "" : dataDicItem1.getName(); |
| 222 | + //判断是否可编辑 | ||
| 223 | + String region = dto.getRegion(); | ||
| 224 | + this.showAudit = false; | ||
| 225 | + if (StringUtil.isNotEmpty(region)) { | ||
| 226 | + SysUserDeptService sysUserDeptService = ApplicationUtil.getBean(SysUserDeptService.class); | ||
| 227 | + List<SysUserDept> byDeptId = sysUserDeptService.getByDeptId(region); | ||
| 228 | + if (CollectionUtils.isNotEmpty(byDeptId)) { | ||
| 229 | + List<String> userIds = byDeptId.stream().map(SysUserDept::getUserId).collect(Collectors.toList()); | ||
| 230 | + String userId = SecurityUtil.getCurrentUser().getId(); | ||
| 231 | + this.showAudit = (userIds.contains(userId)); | ||
| 232 | + } | ||
| 233 | + } | ||
| 206 | } | 234 | } |
| 207 | } | 235 | } |
| 1 | package com.lframework.xingyun.sc.controller.sample; | 1 | package com.lframework.xingyun.sc.controller.sample; |
| 2 | 2 | ||
| 3 | +import com.lframework.starter.bpm.dto.FlowTaskDto; | ||
| 4 | +import com.lframework.starter.bpm.mappers.FlowTaskWrapperMapper; | ||
| 5 | +import com.lframework.starter.bpm.vo.flow.task.QueryTodoTaskListVo; | ||
| 3 | import com.lframework.starter.web.core.annotations.security.HasPermission; | 6 | import com.lframework.starter.web.core.annotations.security.HasPermission; |
| 7 | +import com.lframework.starter.web.core.components.security.SecurityUtil; | ||
| 4 | import com.lframework.starter.web.core.controller.DefaultBaseController; | 8 | import com.lframework.starter.web.core.controller.DefaultBaseController; |
| 5 | import com.lframework.starter.web.core.utils.PageResultUtil; | 9 | import com.lframework.starter.web.core.utils.PageResultUtil; |
| 6 | import com.lframework.starter.web.core.components.resp.PageResult; | 10 | import com.lframework.starter.web.core.components.resp.PageResult; |
| 7 | import com.lframework.starter.web.core.components.resp.InvokeResult; | 11 | import com.lframework.starter.web.core.components.resp.InvokeResult; |
| 8 | - | ||
| 9 | import javax.annotation.Resource; | 12 | import javax.annotation.Resource; |
| 10 | import javax.validation.constraints.NotBlank; | 13 | import javax.validation.constraints.NotBlank; |
| 11 | import com.lframework.xingyun.sc.bo.sample.confirm.GetProductSampleConfirmationSlipBo; | 14 | import com.lframework.xingyun.sc.bo.sample.confirm.GetProductSampleConfirmationSlipBo; |
| @@ -25,8 +28,8 @@ import com.lframework.starter.common.exceptions.impl.DefaultClientException; | @@ -25,8 +28,8 @@ import com.lframework.starter.common.exceptions.impl.DefaultClientException; | ||
| 25 | import io.swagger.annotations.ApiOperation; | 28 | import io.swagger.annotations.ApiOperation; |
| 26 | import com.lframework.starter.common.utils.CollectionUtil; | 29 | import com.lframework.starter.common.utils.CollectionUtil; |
| 27 | import io.swagger.annotations.Api; | 30 | import io.swagger.annotations.Api; |
| 31 | +import org.apache.commons.collections.CollectionUtils; | ||
| 28 | import org.springframework.web.bind.annotation.DeleteMapping; | 32 | import org.springframework.web.bind.annotation.DeleteMapping; |
| 29 | -import org.springframework.beans.factory.annotation.Autowired; | ||
| 30 | import org.springframework.validation.annotation.Validated; | 33 | import org.springframework.validation.annotation.Validated; |
| 31 | import org.springframework.web.bind.annotation.*; | 34 | import org.springframework.web.bind.annotation.*; |
| 32 | import javax.validation.Valid; | 35 | import javax.validation.Valid; |
| @@ -47,6 +50,8 @@ public class ProductSampleConfirmationSlipController extends DefaultBaseControll | @@ -47,6 +50,8 @@ public class ProductSampleConfirmationSlipController extends DefaultBaseControll | ||
| 47 | private ProductSampleConfirmationSlipService productSampleConfirmationSlipService; | 50 | private ProductSampleConfirmationSlipService productSampleConfirmationSlipService; |
| 48 | @Resource | 51 | @Resource |
| 49 | private ProductSampleConfirmationSlipDetailService productSampleConfirmationSlipDetailService; | 52 | private ProductSampleConfirmationSlipDetailService productSampleConfirmationSlipDetailService; |
| 53 | + @Resource | ||
| 54 | + private FlowTaskWrapperMapper flowTaskWrapperMapper; | ||
| 50 | 55 | ||
| 51 | /** | 56 | /** |
| 52 | * 查询列表 | 57 | * 查询列表 |
| @@ -91,6 +96,14 @@ public class ProductSampleConfirmationSlipController extends DefaultBaseControll | @@ -91,6 +96,14 @@ public class ProductSampleConfirmationSlipController extends DefaultBaseControll | ||
| 91 | detailBoList = detailList.stream().map(QueryProductSampleConfirmationSlipDetailBo::new).collect(Collectors.toList()); | 96 | detailBoList = detailList.stream().map(QueryProductSampleConfirmationSlipDetailBo::new).collect(Collectors.toList()); |
| 92 | result.setProductSampleConfirmationSlipDetailList(detailBoList); | 97 | result.setProductSampleConfirmationSlipDetailList(detailBoList); |
| 93 | } | 98 | } |
| 99 | + // 获取当前人员的待办任务数据 | ||
| 100 | + List<FlowTaskDto> flowTaskList = flowTaskWrapperMapper.queryTodoList(new QueryTodoTaskListVo(), SecurityUtil.getCurrentUser().getId()); | ||
| 101 | + if (CollectionUtils.isNotEmpty(flowTaskList)) { | ||
| 102 | + List<String> businessIds = flowTaskList.stream().map(FlowTaskDto::getBusinessId).collect(Collectors.toList()); | ||
| 103 | + result.setShowExamine(businessIds.contains(result.getId())); | ||
| 104 | + } else { | ||
| 105 | + result.setShowExamine(false); | ||
| 106 | + } | ||
| 94 | 107 | ||
| 95 | return InvokeResultBuilder.success(result); | 108 | return InvokeResultBuilder.success(result); |
| 96 | } | 109 | } |
| @@ -29,6 +29,16 @@ public class ProductSampleConfirmationSlip extends BaseEntity implements BaseDto | @@ -29,6 +29,16 @@ public class ProductSampleConfirmationSlip extends BaseEntity implements BaseDto | ||
| 29 | private String id; | 29 | private String id; |
| 30 | 30 | ||
| 31 | /** | 31 | /** |
| 32 | + * 订货单ID | ||
| 33 | + */ | ||
| 34 | + private String orderId; | ||
| 35 | + | ||
| 36 | + /** | ||
| 37 | + * 区域 | ||
| 38 | + */ | ||
| 39 | + private String region; | ||
| 40 | + | ||
| 41 | + /** | ||
| 32 | * 订货单位ID | 42 | * 订货单位ID |
| 33 | */ | 43 | */ |
| 34 | private String orderingUnit; | 44 | private String orderingUnit; |
| @@ -106,6 +116,18 @@ public class ProductSampleConfirmationSlip extends BaseEntity implements BaseDto | @@ -106,6 +116,18 @@ public class ProductSampleConfirmationSlip extends BaseEntity implements BaseDto | ||
| 106 | private String status; | 116 | private String status; |
| 107 | 117 | ||
| 108 | /** | 118 | /** |
| 119 | + * 是否展示编辑按钮 | ||
| 120 | + */ | ||
| 121 | + @TableField(exist = false) | ||
| 122 | + private boolean showAudit; | ||
| 123 | + | ||
| 124 | + /** | ||
| 125 | + * 是否展示审核按钮 | ||
| 126 | + */ | ||
| 127 | + @TableField(exist = false) | ||
| 128 | + private boolean showExamine; | ||
| 129 | + | ||
| 130 | + /** | ||
| 109 | * 办事处内勤ID | 131 | * 办事处内勤ID |
| 110 | */ | 132 | */ |
| 111 | private String officeClerk; | 133 | private String officeClerk; |
| @@ -3,6 +3,9 @@ package com.lframework.xingyun.sc.impl.sample; | @@ -3,6 +3,9 @@ package com.lframework.xingyun.sc.impl.sample; | ||
| 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.bpm.dto.FlowTaskDto; | ||
| 7 | +import com.lframework.starter.bpm.mappers.FlowTaskWrapperMapper; | ||
| 8 | +import com.lframework.starter.bpm.vo.flow.task.QueryTodoTaskListVo; | ||
| 6 | import com.lframework.starter.web.core.components.security.SecurityUtil; | 9 | import com.lframework.starter.web.core.components.security.SecurityUtil; |
| 7 | import com.lframework.starter.web.core.impl.BaseMpServiceImpl; | 10 | import com.lframework.starter.web.core.impl.BaseMpServiceImpl; |
| 8 | import com.lframework.starter.web.core.utils.PageResultUtil; | 11 | import com.lframework.starter.web.core.utils.PageResultUtil; |
| @@ -18,6 +21,7 @@ import com.lframework.starter.common.utils.StringUtil; | @@ -18,6 +21,7 @@ import com.lframework.starter.common.utils.StringUtil; | ||
| 18 | import com.lframework.starter.common.utils.ObjectUtil; | 21 | import com.lframework.starter.common.utils.ObjectUtil; |
| 19 | import com.lframework.starter.common.utils.Assert; | 22 | import com.lframework.starter.common.utils.Assert; |
| 20 | import com.lframework.xingyun.sc.entity.ProductSampleConfirmationSlip; | 23 | import com.lframework.xingyun.sc.entity.ProductSampleConfirmationSlip; |
| 24 | +import com.lframework.xingyun.sc.entity.PurchaseOrderInfo; | ||
| 21 | import com.lframework.xingyun.sc.mappers.ProductSampleConfirmationSlipMapper; | 25 | import com.lframework.xingyun.sc.mappers.ProductSampleConfirmationSlipMapper; |
| 22 | import com.lframework.xingyun.sc.service.sample.ProductSampleConfirmationSlipDetailService; | 26 | import com.lframework.xingyun.sc.service.sample.ProductSampleConfirmationSlipDetailService; |
| 23 | import com.lframework.xingyun.sc.service.sample.ProductSampleConfirmationSlipService; | 27 | import com.lframework.xingyun.sc.service.sample.ProductSampleConfirmationSlipService; |
| @@ -27,11 +31,14 @@ import org.springframework.transaction.annotation.Transactional; | @@ -27,11 +31,14 @@ import org.springframework.transaction.annotation.Transactional; | ||
| 27 | import org.springframework.stereotype.Service; | 31 | import org.springframework.stereotype.Service; |
| 28 | import javax.annotation.Resource; | 32 | import javax.annotation.Resource; |
| 29 | import java.util.List; | 33 | import java.util.List; |
| 34 | +import java.util.stream.Collectors; | ||
| 30 | 35 | ||
| 31 | @Service | 36 | @Service |
| 32 | public class ProductSampleConfirmationSlipServiceImpl extends BaseMpServiceImpl<ProductSampleConfirmationSlipMapper, ProductSampleConfirmationSlip> implements ProductSampleConfirmationSlipService { | 37 | public class ProductSampleConfirmationSlipServiceImpl extends BaseMpServiceImpl<ProductSampleConfirmationSlipMapper, ProductSampleConfirmationSlip> implements ProductSampleConfirmationSlipService { |
| 33 | @Resource | 38 | @Resource |
| 34 | private ProductSampleConfirmationSlipDetailService productSampleConfirmationSlipDetailService; | 39 | private ProductSampleConfirmationSlipDetailService productSampleConfirmationSlipDetailService; |
| 40 | + @Resource | ||
| 41 | + private FlowTaskWrapperMapper flowTaskWrapperMapper; | ||
| 35 | 42 | ||
| 36 | @Override | 43 | @Override |
| 37 | public PageResult<ProductSampleConfirmationSlip> query(Integer pageIndex, Integer pageSize, QueryProductSampleConfirmationSlipVo vo) { | 44 | public PageResult<ProductSampleConfirmationSlip> query(Integer pageIndex, Integer pageSize, QueryProductSampleConfirmationSlipVo vo) { |
| @@ -42,6 +49,22 @@ public class ProductSampleConfirmationSlipServiceImpl extends BaseMpServiceImpl< | @@ -42,6 +49,22 @@ public class ProductSampleConfirmationSlipServiceImpl extends BaseMpServiceImpl< | ||
| 42 | PageHelperUtil.startPage(pageIndex, pageSize); | 49 | PageHelperUtil.startPage(pageIndex, pageSize); |
| 43 | List<ProductSampleConfirmationSlip> datas = this.query(vo); | 50 | List<ProductSampleConfirmationSlip> datas = this.query(vo); |
| 44 | 51 | ||
| 52 | + if (CollectionUtils.isNotEmpty(datas)) { | ||
| 53 | + // 获取当前人员的待办任务数据 | ||
| 54 | + List<FlowTaskDto> flowTaskList = flowTaskWrapperMapper.queryTodoList(new QueryTodoTaskListVo(), SecurityUtil.getCurrentUser().getId()); | ||
| 55 | + if (CollectionUtils.isEmpty(flowTaskList)) { | ||
| 56 | + return PageResultUtil.convert(new PageInfo<>(datas)); | ||
| 57 | + } | ||
| 58 | + List<String> ids = flowTaskList.stream().map(FlowTaskDto::getBusinessId).collect(Collectors.toList()); | ||
| 59 | + for (ProductSampleConfirmationSlip sampleConfirmationSlip : datas) { | ||
| 60 | + if (ids.contains(sampleConfirmationSlip.getId())) { | ||
| 61 | + sampleConfirmationSlip.setShowExamine(true); | ||
| 62 | + } else { | ||
| 63 | + sampleConfirmationSlip.setShowExamine(false); | ||
| 64 | + } | ||
| 65 | + } | ||
| 66 | + } | ||
| 67 | + | ||
| 45 | return PageResultUtil.convert(new PageInfo<>(datas)); | 68 | return PageResultUtil.convert(new PageInfo<>(datas)); |
| 46 | } | 69 | } |
| 47 | 70 | ||
| @@ -64,6 +87,10 @@ public class ProductSampleConfirmationSlipServiceImpl extends BaseMpServiceImpl< | @@ -64,6 +87,10 @@ public class ProductSampleConfirmationSlipServiceImpl extends BaseMpServiceImpl< | ||
| 64 | 87 | ||
| 65 | ProductSampleConfirmationSlip data = new ProductSampleConfirmationSlip(); | 88 | ProductSampleConfirmationSlip data = new ProductSampleConfirmationSlip(); |
| 66 | data.setId(IdUtil.getId()); | 89 | data.setId(IdUtil.getId()); |
| 90 | + data.setOrderId(vo.getOrderId()); | ||
| 91 | + if (!StringUtil.isBlank(vo.getRegion())) { | ||
| 92 | + data.setRegion(vo.getRegion()); | ||
| 93 | + } | ||
| 67 | data.setOrderingUnit(vo.getOrderingUnit()); | 94 | data.setOrderingUnit(vo.getOrderingUnit()); |
| 68 | if (!StringUtil.isBlank(vo.getWorkshopId())) { | 95 | if (!StringUtil.isBlank(vo.getWorkshopId())) { |
| 69 | data.setWorkshopId(vo.getWorkshopId()); | 96 | data.setWorkshopId(vo.getWorkshopId()); |
| @@ -112,7 +139,7 @@ public class ProductSampleConfirmationSlipServiceImpl extends BaseMpServiceImpl< | @@ -112,7 +139,7 @@ public class ProductSampleConfirmationSlipServiceImpl extends BaseMpServiceImpl< | ||
| 112 | .set(ProductSampleConfirmationSlip::getSampleFrequency, StringUtil.isBlank(vo.getSampleFrequency()) ? null : vo.getSampleFrequency()) | 139 | .set(ProductSampleConfirmationSlip::getSampleFrequency, StringUtil.isBlank(vo.getSampleFrequency()) ? null : vo.getSampleFrequency()) |
| 113 | .set(ProductSampleConfirmationSlip::getEarlyNonconformityDescription, StringUtil.isBlank(vo.getEarlyNonconformityDescription()) ? null : vo.getEarlyNonconformityDescription()) | 140 | .set(ProductSampleConfirmationSlip::getEarlyNonconformityDescription, StringUtil.isBlank(vo.getEarlyNonconformityDescription()) ? null : vo.getEarlyNonconformityDescription()) |
| 114 | .set(ProductSampleConfirmationSlip::getPreparedBy, StringUtil.isBlank(vo.getPreparedBy()) ? null : vo.getPreparedBy()) | 141 | .set(ProductSampleConfirmationSlip::getPreparedBy, StringUtil.isBlank(vo.getPreparedBy()) ? null : vo.getPreparedBy()) |
| 115 | - .set(ProductSampleConfirmationSlip::getStatus, StringUtil.isBlank(vo.getStatus()) ? null : vo.getStatus()) | 142 | + .set(ProductSampleConfirmationSlip::getStatus, "AUDIT") |
| 116 | .eq(ProductSampleConfirmationSlip::getId, vo.getId()); | 143 | .eq(ProductSampleConfirmationSlip::getId, vo.getId()); |
| 117 | 144 | ||
| 118 | getBaseMapper().update(updateWrapper); | 145 | getBaseMapper().update(updateWrapper); |
| @@ -3,11 +3,7 @@ package com.lframework.xingyun.sc.vo.sample.confirm; | @@ -3,11 +3,7 @@ package com.lframework.xingyun.sc.vo.sample.confirm; | ||
| 3 | import com.lframework.starter.web.core.components.validation.IsNumberPrecision; | 3 | import com.lframework.starter.web.core.components.validation.IsNumberPrecision; |
| 4 | import java.math.BigDecimal; | 4 | import java.math.BigDecimal; |
| 5 | import javax.validation.constraints.NotBlank; | 5 | import javax.validation.constraints.NotBlank; |
| 6 | -import java.time.LocalDateTime; | ||
| 7 | import com.lframework.starter.web.core.vo.BaseVo; | 6 | import com.lframework.starter.web.core.vo.BaseVo; |
| 8 | -import javax.validation.constraints.NotNull; | ||
| 9 | - | ||
| 10 | -import com.lframework.xingyun.sc.bo.sample.confirm.QueryProductSampleConfirmationSlipDetailBo; | ||
| 11 | import io.swagger.annotations.ApiModelProperty; | 7 | import io.swagger.annotations.ApiModelProperty; |
| 12 | import com.lframework.starter.web.core.components.validation.TypeMismatch; | 8 | import com.lframework.starter.web.core.components.validation.TypeMismatch; |
| 13 | import org.hibernate.validator.constraints.Length; | 9 | import org.hibernate.validator.constraints.Length; |
| @@ -21,6 +17,22 @@ public class CreateProductSampleConfirmationSlipVo implements BaseVo, Serializab | @@ -21,6 +17,22 @@ public class CreateProductSampleConfirmationSlipVo implements BaseVo, Serializab | ||
| 21 | 17 | ||
| 22 | private static final long serialVersionUID = 1L; | 18 | private static final long serialVersionUID = 1L; |
| 23 | 19 | ||
| 20 | + | ||
| 21 | + /** | ||
| 22 | + * 订货单ID | ||
| 23 | + */ | ||
| 24 | + @ApiModelProperty(value = "订货单ID", required = true) | ||
| 25 | + @NotBlank(message = "请输入订货单ID!") | ||
| 26 | + @Length(message = "订货单ID最多允许32个字符!") | ||
| 27 | + private String orderId; | ||
| 28 | + | ||
| 29 | + /** | ||
| 30 | + * 区域 | ||
| 31 | + */ | ||
| 32 | + @ApiModelProperty("区域") | ||
| 33 | + @Length(message = "区域最多允许32个字符!") | ||
| 34 | + private String region; | ||
| 35 | + | ||
| 24 | /** | 36 | /** |
| 25 | * 订货单位ID | 37 | * 订货单位ID |
| 26 | */ | 38 | */ |
| @@ -4,6 +4,8 @@ | @@ -4,6 +4,8 @@ | ||
| 4 | 4 | ||
| 5 | <resultMap id="ProductSampleConfirmationSlip" type="com.lframework.xingyun.sc.entity.ProductSampleConfirmationSlip"> | 5 | <resultMap id="ProductSampleConfirmationSlip" type="com.lframework.xingyun.sc.entity.ProductSampleConfirmationSlip"> |
| 6 | <id column="id" property="id"/> | 6 | <id column="id" property="id"/> |
| 7 | + <result column="order_id" property="orderId"/> | ||
| 8 | + <result column="region" property="region"/> | ||
| 7 | <result column="ordering_unit" property="orderingUnit"/> | 9 | <result column="ordering_unit" property="orderingUnit"/> |
| 8 | <result column="ordering_unit_name" property="orderingUnitName"/> | 10 | <result column="ordering_unit_name" property="orderingUnitName"/> |
| 9 | <result column="sample_type" property="sampleType"/> | 11 | <result column="sample_type" property="sampleType"/> |
| @@ -56,6 +58,8 @@ | @@ -56,6 +58,8 @@ | ||
| 56 | <sql id="ProductSampleConfirmationSlip_sql"> | 58 | <sql id="ProductSampleConfirmationSlip_sql"> |
| 57 | SELECT | 59 | SELECT |
| 58 | tb.id, | 60 | tb.id, |
| 61 | + tb.order_id, | ||
| 62 | + tb.region, | ||
| 59 | tb.ordering_unit, | 63 | tb.ordering_unit, |
| 60 | cu.name AS ordering_unit_name, | 64 | cu.name AS ordering_unit_name, |
| 61 | tb.sample_type, | 65 | tb.sample_type, |