|
@@ -27,7 +27,7 @@ import java.util.List;
|
|
* 发起申购流程
|
|
* 发起申购流程
|
|
*/
|
|
*/
|
|
@Service
|
|
@Service
|
|
-public class ApplyFlow extends FlowDelegate {
|
|
+public class ApplyBuyFlow extends FlowDelegate {
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
private ApplyBuyService applyBuyService;
|
|
private ApplyBuyService applyBuyService;
|
|
@@ -42,6 +42,7 @@ public class ApplyFlow extends FlowDelegate {
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public Long start(Long flowId, JSONObject submitData) {
|
|
public Long start(Long flowId, JSONObject submitData) {
|
|
|
|
+
|
|
ApplyBuyDto applyBuyDto = submitData.toJavaObject(ApplyBuyDto.class);
|
|
ApplyBuyDto applyBuyDto = submitData.toJavaObject(ApplyBuyDto.class);
|
|
validated(applyBuyDto);
|
|
validated(applyBuyDto);
|
|
|
|
|
|
@@ -66,19 +67,16 @@ public class ApplyFlow extends FlowDelegate {
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public void end(Long flowId, Long businessId, JSONObject submitData) {
|
|
public void end(Long flowId, Long businessId, JSONObject submitData) {
|
|
-
|
|
|
|
applyBuyService.update(q -> q
|
|
applyBuyService.update(q -> q
|
|
.eq(BaseIdPo::getId, businessId)
|
|
.eq(BaseIdPo::getId, businessId)
|
|
.set(ApplyBuy::getFlowStatus, FlowStatusEnum.PASS.getKey())
|
|
.set(ApplyBuy::getFlowStatus, FlowStatusEnum.PASS.getKey())
|
|
.set(BasePo::getUpdateTime, new Date())
|
|
.set(BasePo::getUpdateTime, new Date())
|
|
.set(BasePo::getUpdateUser, SecurityUtils.getUserId())
|
|
.set(BasePo::getUpdateUser, SecurityUtils.getUserId())
|
|
);
|
|
);
|
|
-
|
|
|
|
}
|
|
}
|
|
|
|
|
|
public void jump() {
|
|
public void jump() {
|
|
-
|
|
+
|
|
-
|
|
|
|
if (HandleTypeEnum.REJECT.equals(FlowThreadLocalUtil.getHandleTypeEnum())) {
|
|
if (HandleTypeEnum.REJECT.equals(FlowThreadLocalUtil.getHandleTypeEnum())) {
|
|
applyBuyService.update(q -> q
|
|
applyBuyService.update(q -> q
|
|
.eq(BaseIdPo::getId, FlowThreadLocalUtil.getBusinessId())
|
|
.eq(BaseIdPo::getId, FlowThreadLocalUtil.getBusinessId())
|
|
@@ -87,14 +85,12 @@ public class ApplyFlow extends FlowDelegate {
|
|
.set(BasePo::getUpdateUser, SecurityUtils.getUserId())
|
|
.set(BasePo::getUpdateUser, SecurityUtils.getUserId())
|
|
);
|
|
);
|
|
}
|
|
}
|
|
-
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
* 验证数据
|
|
* 验证数据
|
|
*/
|
|
*/
|
|
private void validated(ApplyBuyDto applyBuyDto) {
|
|
private void validated(ApplyBuyDto applyBuyDto) {
|
|
-
|
|
|
|
Assert.notBlank(applyBuyDto.getApplyName(), "申购人不能为空");
|
|
Assert.notBlank(applyBuyDto.getApplyName(), "申购人不能为空");
|
|
Assert.notEmpty(applyBuyDto.getApplyTime(), "申购时间不能为空");
|
|
Assert.notEmpty(applyBuyDto.getApplyTime(), "申购时间不能为空");
|
|
|
|
|
|
@@ -102,11 +98,10 @@ public class ApplyFlow extends FlowDelegate {
|
|
Assert.notEmpty(applyBuyBomList, "申购清单不能为空");
|
|
Assert.notEmpty(applyBuyBomList, "申购清单不能为空");
|
|
|
|
|
|
for (ApplyBuyBom applyBuyBom : applyBuyBomList) {
|
|
for (ApplyBuyBom applyBuyBom : applyBuyBomList) {
|
|
- Assert.notNull(applyBuyBom.getBomSpecId(), "bomId不能为空");
|
|
+ Assert.notNull(applyBuyBom.getBomSpecId(), "bom规格Id不能为空");
|
|
Assert.notNull(applyBuyBom.getQuantity(), "申购数量不能为空");
|
|
Assert.notNull(applyBuyBom.getQuantity(), "申购数量不能为空");
|
|
Assert.gtZero(applyBuyBom.getQuantity(), "申购数量必须大于0");
|
|
Assert.gtZero(applyBuyBom.getQuantity(), "申购数量必须大于0");
|
|
}
|
|
}
|
|
-
|
|
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
}
|