Commit c9b38876ce625743ad5b41d5becbca3e223123fe

Authored by 房远帅
1 parent a470621a

楚江ERP:订货单新增个类型(无需生产、需要生产)

... ... @@ -222,6 +222,12 @@ public class GetPurchaseOrderInfoBo extends BaseBo<PurchaseOrderInfo> {
222 222 @ApiModelProperty("规格变更状态")
223 223 private String specChangeStatus;
224 224
  225 + /**
  226 + * 订货单类型(生产:PRODUCTION 无需生产:NO_PRODUCTION)
  227 + */
  228 + @ApiModelProperty("订货单类型")
  229 + private String type;
  230 +
225 231
226 232
227 233 public GetPurchaseOrderInfoBo() {
... ...
... ... @@ -123,9 +123,9 @@ public class GetPurchaseOrderLineBo extends BaseBo<PurchaseOrderLine> {
123 123 private BigDecimal salesPrice;
124 124
125 125 /**
126   - * 货日期
  126 + * 货日期
127 127 */
128   - @ApiModelProperty("货日期")
  128 + @ApiModelProperty("货日期")
129 129 @JsonFormat(pattern = StringPool.DATE_PATTERN)
130 130 private LocalDate deliveryDate;
131 131
... ...
... ... @@ -9,9 +9,12 @@ import com.lframework.starter.web.core.annotations.security.HasPermission;
9 9 import com.lframework.starter.web.core.components.resp.InvokeResult;
10 10 import com.lframework.starter.web.core.components.resp.InvokeResultBuilder;
11 11 import com.lframework.starter.web.core.components.resp.PageResult;
  12 +import com.lframework.starter.web.core.components.security.SecurityUtil;
12 13 import com.lframework.starter.web.core.controller.DefaultBaseController;
13 14 import com.lframework.starter.web.core.utils.PageResultUtil;
  15 +import com.lframework.starter.web.inner.entity.SysRole;
14 16 import com.lframework.starter.web.inner.entity.SysUser;
  17 +import com.lframework.starter.web.inner.service.system.SysRoleService;
15 18 import com.lframework.starter.web.inner.service.system.SysUserService;
16 19 import com.lframework.xingyun.sc.bo.order.GetPurchaseOrderInfoBo;
17 20 import com.lframework.xingyun.sc.entity.PurchaseOrderInfo;
... ... @@ -74,6 +77,8 @@ public class PurchaseOrderInfoController extends DefaultBaseController {
74 77 private PurchaseOrderLineService purchaseOrderLineService;
75 78 @Autowired
76 79 private SysUserService sysUserService;
  80 + @Resource
  81 + private SysRoleService sysRoleService;
77 82
78 83 /**
79 84 * 查询列表
... ... @@ -134,6 +139,23 @@ public class PurchaseOrderInfoController extends DefaultBaseController {
134 139 vo.setPurchaseOrderId(id);
135 140 List<PurchaseOrderLine> purchaseOrderLineList = purchaseOrderLineService.query(vo);
136 141 if (CollectionUtil.isNotEmpty(purchaseOrderLineList)) {
  142 + //生产人员不展示价格,生产人员角色只会有单个
  143 + List<SysRole> sysRoleList = sysRoleService.getByUserId(SecurityUtil.getCurrentUser().getId());
  144 + if (CollectionUtils.isNotEmpty(sysRoleList)) {
  145 + Boolean b = false;
  146 + for (SysRole sysRole : sysRoleList) {
  147 + //todo 生产人员角色未确定
  148 + if ("scry".equals(sysRole.getCode())) {
  149 + b = true;
  150 + break;
  151 + }
  152 + }
  153 + if (b) {
  154 + for (PurchaseOrderLine purchaseOrderLine : purchaseOrderLineList) {
  155 + purchaseOrderLine.setSalesPrice(null);
  156 + }
  157 + }
  158 + }
137 159 result.setPurchaseOrderLineList(purchaseOrderLineList);
138 160 }
139 161
... ...
... ... @@ -180,6 +180,11 @@ public class PurchaseOrderInfo extends BaseEntity implements BaseDto {
180 180 private String specChangeStatus;
181 181
182 182 /**
  183 + * 订货单类型(生产:PRODUCTION 无需生产:NO_PRODUCTION)
  184 + */
  185 + private String type;
  186 +
  187 + /**
183 188 * 创建人ID
184 189 */
185 190 @TableField(fill = FieldFill.INSERT)
... ...
... ... @@ -168,6 +168,9 @@ public class PurchaseOrderInfoServiceImpl extends BaseMpServiceImpl<PurchaseOrde
168 168 if (!StringUtil.isBlank(vo.getWorkshopId())) {
169 169 data.setWorkshopId(vo.getWorkshopId());
170 170 }
  171 + if (!StringUtil.isBlank(vo.getType())) {
  172 + data.setType(vo.getType());
  173 + }
171 174
172 175 getBaseMapper().insert(data);
173 176
... ...
... ... @@ -189,4 +189,10 @@ public class CreatePurchaseOrderInfoVo implements BaseVo, Serializable {
189 189 @ApiModelProperty("订货单物料行")
190 190 private List<CreatePurchaseOrderLineVo> createPurchaseOrderLineVoList;
191 191
  192 + /**
  193 + * 订货单类型(生产:PRODUCTION 无需生产:NO_PRODUCTION)
  194 + */
  195 + @ApiModelProperty("订货单类型")
  196 + private String type;
  197 +
192 198 }
... ...
... ... @@ -141,10 +141,10 @@ public class CreatePurchaseOrderLineVo implements BaseVo, Serializable {
141 141 private BigDecimal salesPrice;
142 142
143 143 /**
144   - * 货日期
  144 + * 货日期
145 145 */
146   - @ApiModelProperty("交货日期")
147   - @TypeMismatch(message = "交货日期格式有误!")
  146 + @ApiModelProperty("发货日期")
  147 + @TypeMismatch(message = "发货日期格式有误!")
148 148 private LocalDate deliveryDate;
149 149
150 150 /**
... ...
... ... @@ -71,4 +71,10 @@ public class QueryPurchaseOrderInfoVo extends PageVo implements BaseVo, Serializ
71 71 @ApiModelProperty("生产厂")
72 72 private String workshopId;
73 73
  74 + /**
  75 + * 订货单类型(生产:PRODUCTION 无需生产:NO_PRODUCTION)
  76 + */
  77 + @ApiModelProperty("订货单类型")
  78 + private String type;
  79 +
74 80 }
... ...
... ... @@ -32,10 +32,10 @@ public class QueryPurchaseOrderLineVo extends PageVo implements BaseVo, Serializ
32 32 private String status;
33 33
34 34 /**
35   - * 货日期
  35 + * 货日期
36 36 */
37   - @ApiModelProperty("交货日期")
38   - @TypeMismatch(message = "交货日期格式有误!")
  37 + @ApiModelProperty("发货日期")
  38 + @TypeMismatch(message = "发货日期格式有误!")
39 39 private LocalDate deliveryDate;
40 40
41 41 }
... ...
... ... @@ -197,4 +197,10 @@ public class UpdatePurchaseOrderInfoVo implements BaseVo, Serializable {
197 197 @ApiModelProperty("订货单表物料行")
198 198 private List<UpdatePurchaseOrderLineVo> updatePurchaseOrderLineVoList;
199 199
  200 + /**
  201 + * 订货单类型(生产:PRODUCTION 无需生产:NO_PRODUCTION)
  202 + */
  203 + @ApiModelProperty("订货单类型")
  204 + private String type;
  205 +
200 206 }
... ...
... ... @@ -148,10 +148,10 @@ public class UpdatePurchaseOrderLineVo implements BaseVo, Serializable {
148 148 private BigDecimal salesPrice;
149 149
150 150 /**
151   - * 货日期
  151 + * 货日期
152 152 */
153   - @ApiModelProperty("交货日期")
154   - @TypeMismatch(message = "交货日期格式有误!")
  153 + @ApiModelProperty("发货日期")
  154 + @TypeMismatch(message = "发货日期格式有误!")
155 155 private LocalDate deliveryDate;
156 156
157 157 /**
... ...
... ... @@ -32,6 +32,7 @@
32 32 <result column="workshop_name" property="workshopName"/>
33 33 <result column="customer_credit_id" property="customerCreditId"/>
34 34 <result column="customer_tier" property="customerTier"/>
  35 + <result column="type" property="type"/>
35 36 <result column="create_by_id" property="createById"/>
36 37 <result column="create_by" property="createBy"/>
37 38 <result column="update_by_id" property="updateById"/>
... ... @@ -71,6 +72,7 @@
71 72 ws.name AS workshop_name,
72 73 tb.customer_credit_id,
73 74 cc.company_suggested_category AS customer_tier,
  75 + tb.type,
74 76 tb.create_by_id,
75 77 tb.create_by,
76 78 tb.update_by_id,
... ... @@ -116,6 +118,9 @@
116 118 <if test="vo.workshopId != null and vo.workshopId != ''">
117 119 AND tb.workshop_id = #{vo.workshopId}
118 120 </if>
  121 + <if test="vo.type != null and vo.type != ''">
  122 + AND tb.type = #{vo.type}
  123 + </if>
119 124 </where>
120 125 ORDER BY tb.update_time DESC
121 126 </select>
... ... @@ -155,6 +160,7 @@
155 160 AND (tb.revoke_status = '' OR tb.revoke_status = null OR tb.revoke_status='CANCEL' OR
156 161 tb.revoke_status='PARTIAL')
157 162 AND (tb.status='ISSUED' OR tb.status='WAIT' OR tb.status='TRANSIT')
  163 + AND tb.type ='PRODUCTION'
158 164 </where>
159 165 ORDER BY tb.update_time DESC
160 166 </select>
... ...