流程新加逻辑

product
17602169347 2 years ago
parent 322e464461
commit de2dd39319

@ -68,4 +68,7 @@
WHERE 1=1 AND o.F_Completion = 0 AND t.F_Status = 1 AND o.F_State = '0' ${sql}
</select>
<update id="updatePurchaseorder" parameterType="String">
UPDATE jg_purchaseorder SET is_payment = '0' WHERE id IN (SELECT purchaseorder_id FROM jg_paymentdoc_item0 WHERE paymentdoc_id = #{paymentdocId})
</update>
</mapper>

@ -26,6 +26,8 @@ import jnpf.engine.util.FlowJsonUtil;
import jnpf.engine.util.FlowNature;
import jnpf.engine.util.ServiceAllUtil;
import jnpf.exception.WorkFlowException;
import jnpf.form.entity.PoundlistFlowEntity;
import jnpf.form.service.PoundlistFlowService;
import jnpf.permission.entity.UserEntity;
import jnpf.util.JsonUtil;
import jnpf.util.RedisUtil;
@ -72,6 +74,8 @@ public class FlowBeforeController {
private FlowEngineService flowEngineService;
@Autowired
private FlowTaskNewService flowTaskNewService;
@Autowired
private PoundlistFlowService poundlistFlowService;
/**
*
@ -141,7 +145,27 @@ public class FlowBeforeController {
@PostMapping("/Audit/{id}")
public ActionResult audit(@PathVariable("id") String id, @RequestBody FlowHandleModel flowHandleModel) throws WorkFlowException {
FlowTaskOperatorEntity operator = flowTaskOperatorService.getInfo(id);
FlowTaskNodeEntity flowTaskNodeEntity = flowTaskNodeService.getById(operator.getTaskNodeId());
FlowTaskEntity flowTask = flowTaskService.getInfo(operator.getTaskId());
if("end".equals(flowTaskNodeEntity.getNodeNext()) && "398482034802139205".equals(flowTask.getFlowId())){
//判断当前采购订单的磅单有没有是否垫资为否,并且是否回款为否
//判断是否开进项票
Map<String, Object> map = flowHandleModel.getFormData();
List<Map<String, Object>> paymentdocitem1List = (List<Map<String, Object>>)map.get("paymentdocitem1List");
List<String> poundListIds = new ArrayList<>();
for (Map<String, Object> paymentdocitem1 : paymentdocitem1List) {
poundListIds.add((String)paymentdocitem1.get("poundlistId"));
}
List<PoundlistFlowEntity> poundlistFlowEntityList = poundlistFlowService.listByIds(poundListIds);
for (PoundlistFlowEntity poundlistFlowEntity : poundlistFlowEntityList) {
if("0".equals(poundlistFlowEntity.getIsInvoicing())){
return ActionResult.fail("存在磅单未开进项票,无法审批通过!");
}
if("0".equals(poundlistFlowEntity.getAdvance()) && "0".equals(poundlistFlowEntity.getIsCollection())){
return ActionResult.fail("存在磅单未垫资且未回款,无法审批通过!");
}
}
}
flowTaskNewService.permissions(operator.getHandleId(), flowTask, operator, "");
if (FlowNature.ProcessCompletion.equals(operator.getCompletion())) {
FlowModel flowModel = JsonUtil.getJsonToBean(flowHandleModel, FlowModel.class);
@ -213,6 +237,9 @@ public class FlowBeforeController {
FlowTaskOperatorEntity operator = flowTaskOperatorService.getInfo(id);
FlowTaskEntity flowTask = flowTaskService.getInfo(operator.getTaskId());
flowTaskNewService.permissions(operator.getHandleId(), flowTask, operator, "");
if("398482034802139205".equals(flowTask.getFlowId())){
flowTaskService.updatePurchaseorder(flowTask.getProcessId());
}
if (FlowNature.ProcessCompletion.equals(operator.getCompletion())) {
FlowModel flowModel = JsonUtil.getJsonToBean(flowHandleModel, FlowModel.class);
UserInfo userInfo = userProvider.get();

@ -126,6 +126,9 @@ public class FlowLaunchController {
@PutMapping("/{id}/Actions/Withdraw")
public ActionResult revoke(@PathVariable("id") String id, @RequestBody FlowHandleModel flowHandleModel) throws WorkFlowException {
FlowTaskEntity flowTaskEntity = flowTaskService.getInfo(id);
if("398482034802139205".equals(flowTaskEntity.getFlowId())){
flowTaskService.updatePurchaseorder(flowTaskEntity.getProcessId());
}
FlowModel flowModel = JsonUtil.getJsonToBean(flowHandleModel, FlowModel.class);
flowTaskNewService.revoke(flowTaskEntity, flowModel);
return ActionResult.success("撤回成功");

@ -37,4 +37,11 @@ public interface FlowTaskMapper extends BaseMapper<FlowTaskEntity> {
* @return
*/
List<FlowTaskListModel> getWaitList(@Param("sql") String sql);
/**
* isPayment0
* @param paymentdocId
* @return
*/
void updatePurchaseorder(@Param("paymentdocId") String paymentdocId);
}

@ -232,4 +232,11 @@ public interface FlowTaskService extends IService<FlowTaskEntity> {
* @return
*/
List<FlowBatchModel> batchFlowSelector();
/**
* isPayment0
* @param paymentdocId
* @return
*/
void updatePurchaseorder(String paymentdocId);
}

@ -671,6 +671,11 @@ public class FlowTaskServiceImpl extends ServiceImpl<FlowTaskMapper, FlowTaskEnt
return batchFlowList;
}
@Override
public void updatePurchaseorder(String paymentdocId) {
this.baseMapper.updatePurchaseorder(paymentdocId);
}
/**
*
*

@ -0,0 +1,241 @@
package jnpf.form.entity;
import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import java.math.BigDecimal;
import java.util.Date;
/**
*
*
* @ V3.2.0
* @ LINKAGE-BOOT
* @ LINKAGE-BOOT
* @ 2023-02-21
*/
@Data
@TableName("jg_poundlist")
public class PoundlistFlowEntity {
@TableId("ID")
private String id;
@TableField(value = "CREATOR_USER_ID",fill = FieldFill.INSERT)
private String creatorUserId;
@TableField(value = "CREATOR_USER_NAME",fill = FieldFill.INSERT)
private String creatorUserName;
@TableField(value = "CREATOR_TIME",fill = FieldFill.INSERT)
private Date creatorTime;
@TableField(value = "LAST_MODIFY_USER_ID",fill = FieldFill.INSERT_UPDATE)
private String lastModifyUserId;
@TableField(value = "LAST_MODIFY_USER_NAME",fill = FieldFill.INSERT_UPDATE)
private String lastModifyUserName;
@TableField(value = "LAST_MODIFY_TIME",fill = FieldFill.INSERT_UPDATE)
private Date lastModifyTime;
@TableField(value = "DELETE_USER_ID",fill = FieldFill.UPDATE)
private String deleteUserId;
@TableField(value = "DELETE_USER_NAME",fill = FieldFill.UPDATE)
private String deleteUserName;
@TableField(value = "DELETE_TIME",fill = FieldFill.UPDATE)
private Date deleteTime;
@TableField("DELETE_MARK")
@TableLogic
private String deleteMark;
@TableField(value = "ORGNIZE_ID",fill = FieldFill.INSERT)
private String orgnizeId;
@TableField(value = "DEPARTMENT_ID",fill = FieldFill.INSERT)
private String departmentId;
@TableField("CUSTOMER_ID")
private String customerId;
@TableField("SALES_ID")
private String salesId;
@TableField("SUPPLIER_ID")
private String supplierId;
@TableField("SUPPLIER_NAME")
private String supplierName;
@TableField("PURCHASE_ID")
private String purchaseId;
@TableField("MATERIAL_ID")
private String materialId;
@TableField("ADVANCE")
private String advance;
@TableField("UNIT")
private String unit;
@TableField("GROSS_WEIGHT")
private BigDecimal grossWeight;
@TableField("TARE_WEIGHT")
private BigDecimal tareWeight;
@TableField("BUCKLE_WEIGHT")
private BigDecimal buckleWeight;
@TableField("NET_WEIGHT")
private BigDecimal netWeight;
@TableField("SETTLEMENT")
private BigDecimal settlement;
@TableField("PURCHASE_PRICE")
private BigDecimal purchasePrice;
@TableField("COLLECT_PRICE")
private BigDecimal collectPrice;
@TableField("SALES_PRICE")
private BigDecimal salesPrice;
@TableField("INPUT_DATE")
private Date inputDate;
@TableField("OUTPUT_DATE")
private Date outputDate;
@TableField("PAY_DATE")
private Date payDate;
@TableField("PAYMENT_DATE")
private Date paymentDate;
@TableField("POUND_DATE")
private Date poundDate;
@TableField("BUSINESS_ID")
private String businessId;
@TableField("POUND_PICTURES")
private String poundPictures;
@TableField("VEHICLE_PICTURES")
private String vehiclePictures;
@TableField("POUND_TYPE")
private String poundType;
@TableField("POUND_STATUS")
private String poundStatus;
@TableField("SALES_STATUS")
private String salesStatus;
@TableField("PURCHASE_STATUS")
private String purchaseStatus;
@TableField("REMARK")
private String remark;
@TableField("TRANSPORT_TYPE")
private String transportType;
@TableField("TRANSPORT_PRICE")
private BigDecimal transportPrice;
@TableField("ORIGIN_PLACE")
private String originPlace;
@TableField("NATURAL_ID")
private String naturalId;
@TableField("POUNDLIST_NO")
private String poundlistNo;
@TableField("VEHICLE_ID")
private String vehicleId;
@TableField("IS_EXAMINE")
private String isExamine;
@TableField("IS_INVOICING")
private String isInvoicing;
@TableField("IS_PAY")
private String isPay;
@TableField("IS_COLLECTION")
private String isCollection;
@TableField("IS_EXPENSE")
private String isExpense;
@TableField(exist = false)
private String materialName;
@TableField(exist = false)
private String customerName;
@TableField(exist = false)
private String salesName;
@TableField(exist = false)
private String vehicleName;
@TableField(exist = false)
private String businessName;
@TableField(exist = false)
private String naturalName;
@TableField(exist = false)
private String purchaseName;
@TableField(exist = false)
private String contractNo;
@TableField(exist = false)
private String purchaseContractNo;
@TableField(exist = false)
private String documentNo;
@TableField(exist = false)
private String rate;
@TableField(exist = false)
private BigDecimal unitPrice;
@TableField(exist = false)
private BigDecimal noPrice;
@TableField(exist = false)
private BigDecimal price;
@TableField(exist = false)
private String salesContractNo;
@TableField(exist = false)
private String purchaseorderItem0Id;
@TableField(exist = false)
private String salesorderItem0Id;
@TableField(exist = false)
private String saleRate;
@TableField(exist = false)
private String amount;
@TableField(exist = false)
private String notAmount;
@TableField(exist = false)
private String isFirstpay = "0";
@TableField(exist = false)
private String purchaseorderNo;
@TableField(exist = false)
private String collectionAccount;
@TableField(exist = false)
private String colectionBank;
@TableField(exist = false)
private String poundlistId;
@TableField(exist = false)
private String ContractName;
}

@ -0,0 +1,16 @@
package jnpf.form.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import jnpf.form.entity.PoundlistFlowEntity;
/**
*
* poundlist
* V3.2.0
* LINKAGE-BOOT
* LINKAGE-BOOT
* 2023-02-21
*/
public interface PoundlistFlowMapper extends BaseMapper<PoundlistFlowEntity> {
}

@ -0,0 +1,15 @@
package jnpf.form.service;
import com.baomidou.mybatisplus.extension.service.IService;
import jnpf.form.entity.PoundlistFlowEntity;
/**
*
* poundlist
* V3.2.0
* LINKAGE-BOOT
* LINKAGE-BOOT
* 2023-02-21
*/
public interface PoundlistFlowService extends IService<PoundlistFlowEntity> {
}

@ -0,0 +1,19 @@
package jnpf.form.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import jnpf.form.entity.PoundlistFlowEntity;
import jnpf.form.mapper.PoundlistFlowMapper;
import jnpf.form.service.PoundlistFlowService;
import org.springframework.stereotype.Service;
/**
* poundlist
* V3.2.0
* LINKAGE-BOOT
* LINKAGE-BOOT
* 2023-02-21
*/
@Service
public class PoundlistFlowServiceImpl extends ServiceImpl<PoundlistFlowMapper, PoundlistFlowEntity> implements PoundlistFlowService {
}

@ -439,9 +439,9 @@
</el-select>
</template>
</el-table-column>
<el-table-column prop="price" label="单价" align="center" width="130">
<el-table-column prop="purchasePrice" label="单价" align="center" width="130">
<template slot-scope="scope">
<el-input v-model="scope.row.price" placeholder="请输入" clearable
<el-input v-model="scope.row.purchasePrice" placeholder="请输入" clearable
:style='{"width":"100%"}' :disabled="true">
</el-input>
</template>
@ -969,7 +969,6 @@
paymentAmountHistory = paymentAmountHistory + item.payPrice; //
unpaymentAmount = unpaymentAmount + (item.allAmount - item.payPrice); //
item.poundlistEntityList.forEach((item2, index2) => {
item2.price = item2.purchasePrice;
item2.poundlistId = item2.id;
item2.purchaseorderId = item.purchaseorderId;
item2.id = '';

Loading…
Cancel
Save