@ -4,6 +4,7 @@ import cn.afterturn.easypoi.excel.entity.ExportParams;
import cn.afterturn.easypoi.excel.entity.enmus.ExcelType ;
import cn.afterturn.easypoi.excel.entity.enmus.ExcelType ;
import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity ;
import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity ;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper ;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper ;
import com.fasterxml.jackson.annotation.JsonProperty ;
import io.swagger.annotations.Api ;
import io.swagger.annotations.Api ;
import io.swagger.annotations.ApiOperation ;
import io.swagger.annotations.ApiOperation ;
import jnpf.base.ActionResult ;
import jnpf.base.ActionResult ;
@ -17,6 +18,8 @@ import jnpf.contractfile.service.ContractFileService;
import jnpf.exception.DataException ;
import jnpf.exception.DataException ;
import jnpf.payment.entity.PaymentEntity ;
import jnpf.payment.entity.PaymentEntity ;
import jnpf.payment.service.PaymentService ;
import jnpf.payment.service.PaymentService ;
import jnpf.poundlist.entity.PoundlistEntity ;
import jnpf.poundlist.service.PoundlistService ;
import jnpf.purchaseback.entity.PurchaseorderEntity ;
import jnpf.purchaseback.entity.PurchaseorderEntity ;
import jnpf.purchaseback.service.PurchaseorderService ;
import jnpf.purchaseback.service.PurchaseorderService ;
import org.apache.commons.lang3.StringUtils ;
import org.apache.commons.lang3.StringUtils ;
@ -26,6 +29,8 @@ import jnpf.paymentdoc.model.paymentdoc.*;
import jnpf.paymentdoc.model.paymentdoc.PaymentdocPagination ;
import jnpf.paymentdoc.model.paymentdoc.PaymentdocPagination ;
import jnpf.paymentdoc.entity.* ;
import jnpf.paymentdoc.entity.* ;
import jnpf.paymentdoc.entity.PaymentdocItem0Entity ;
import jnpf.paymentdoc.entity.PaymentdocItem0Entity ;
import jnpf.paymentdoc.entity.PaymentdocItem1Entity ;
import jnpf.paymentdoc.entity.PaymentdocItem2Entity ;
import jnpf.util.* ;
import jnpf.util.* ;
import jnpf.base.util.* ;
import jnpf.base.util.* ;
import jnpf.base.vo.ListVO ;
import jnpf.base.vo.ListVO ;
@ -43,6 +48,10 @@ import jnpf.paymentdoc.entity.PaymentdocEntity;
import jnpf.paymentdoc.service.PaymentdocService ;
import jnpf.paymentdoc.service.PaymentdocService ;
import jnpf.paymentdoc.entity.PaymentdocItem0Entity ;
import jnpf.paymentdoc.entity.PaymentdocItem0Entity ;
import jnpf.paymentdoc.service.PaymentdocItem0Service ;
import jnpf.paymentdoc.service.PaymentdocItem0Service ;
import jnpf.paymentdoc.entity.PaymentdocItem1Entity ;
import jnpf.paymentdoc.service.PaymentdocItem1Service ;
import jnpf.paymentdoc.entity.PaymentdocItem2Entity ;
import jnpf.paymentdoc.service.PaymentdocItem2Service ;
import jnpf.exception.WorkFlowException ;
import jnpf.exception.WorkFlowException ;
import jnpf.engine.enums.FlowStatusEnum ;
import jnpf.engine.enums.FlowStatusEnum ;
import org.springframework.web.bind.annotation.* ;
import org.springframework.web.bind.annotation.* ;
@ -53,6 +62,8 @@ import java.io.FileNotFoundException;
import java.io.FileOutputStream ;
import java.io.FileOutputStream ;
import java.io.IOException ;
import java.io.IOException ;
import jnpf.util.GeneraterSwapUtil ;
import jnpf.util.GeneraterSwapUtil ;
import java.math.BigDecimal ;
import java.util.* ;
import java.util.* ;
import jnpf.util.file.UploadUtil ;
import jnpf.util.file.UploadUtil ;
@ -65,7 +76,7 @@ import jnpf.util.enums.FileTypeEnum;
* @ 版 本 : V3 .2 .0
* @ 版 本 : V3 .2 .0
* @ 版 权 : LINKAGE - BOOT
* @ 版 权 : LINKAGE - BOOT
* @ 作 者 : LINKAGE - BOOT 研 发 团 队
* @ 作 者 : LINKAGE - BOOT 研 发 团 队
* @ 日 期 : 2023 - 0 2- 23
* @ 日 期 : 2023 - 0 3- 22
* /
* /
@Slf4j
@Slf4j
@RestController
@RestController
@ -86,15 +97,19 @@ public class PaymentdocController {
@Autowired
@Autowired
private PaymentdocItem0Service paymentdocItem0Service ;
private PaymentdocItem0Service paymentdocItem0Service ;
@Autowired
private PaymentdocItem1Service paymentdocItem1Service ;
@Autowired
private PaymentdocItem2Service paymentdocItem2Service ;
@Autowired
@Autowired
private PurchaseorderService purchaseorderService ;
private PurchaseorderService purchaseorderService ;
@Autowired
@Autowired
private ContractFileService contractFileService ;
private ContractFileService contractFileService ;
@Autowired
@Autowired
private PaymentService paymentService ;
private PaymentService paymentService ;
@Autowired
private PoundlistService poundlistService ;
/ * *
/ * *
* 列 表
* 列 表
@ -107,21 +122,19 @@ public class PaymentdocController {
List < PaymentdocEntity > list = paymentdocService . getList ( paymentdocPagination ) ;
List < PaymentdocEntity > list = paymentdocService . getList ( paymentdocPagination ) ;
//处理id字段转名称, 若无需转或者为空可删除
//处理id字段转名称, 若无需转或者为空可删除
for ( PaymentdocEntity entity : list ) {
for ( PaymentdocEntity entity : list ) {
/ * Map < String , Object > purchaseIdMap = new HashMap < > ( ) ;
entity . setPurchaseId ( generaterSwapUtil . getPopupSelectValue ( "389673535976550149" , "id" , "document_no" , entity . getPurchaseId ( ) , purchaseIdMap ) ) ;
Map < String , Object > contractIdMap = new HashMap < > ( ) ;
entity . setContractId ( generaterSwapUtil . getPopupSelectValue ( "389673903103979269" , "id" , "contract_name" , entity . getContractId ( ) , contractIdMap ) ) ;
Map < String , Object > supplierIdMap = new HashMap < > ( ) ;
Map < String , Object > supplierIdMap = new HashMap < > ( ) ;
entity . setSupplier Id ( generaterSwapUtil . getPopupSelectValue ( "389674191453990661" , "id" , "supplier_name" , entity . getSupplierId ( ) , supplierIdMap ) ) ; * /
entity . setSupplierName ( generaterSwapUtil . getPopupSelectValue ( "389674191453990661" , "id" , "supplier_name" , entity . getSupplierId ( ) , supplierIdMap ) ) ;
QueryWrapper < PaymentEntity > PaymentqueryWrapper = new QueryWrapper < > ( ) ;
QueryWrapper < PaymentEntity > PaymentqueryWrapper = new QueryWrapper < > ( ) ;
PaymentqueryWrapper . lambda ( ) . eq ( PaymentEntity : : getPaymentno , entity . getDocumentNo ( ) ) ;
PaymentqueryWrapper . lambda ( ) . eq ( PaymentEntity : : getPaymentno , entity . getDocumentNo ( ) ) ;
PaymentEntity paymentEntity = paymentService . getOne ( PaymentqueryWrapper ) ;
List < PaymentEntity > paymentEntityList = paymentService . list ( PaymentqueryWrapper ) ;
if ( paymentEntity ! = null ) {
if ( paymentEntityList ! = null & & paymentEntityList . size ( ) > 0 ) {
entity . setPaymentEntity ( paymentEntity ) ;
PaymentEntity paymentEntity = paymentEntityList . get ( 0 ) ;
} else {
if ( paymentEntity ! = null ) {
entity . setPaymentEntity ( new PaymentEntity ( ) ) ;
entity . setPaymentEntity ( paymentEntity ) ;
} else {
entity . setPaymentEntity ( new PaymentEntity ( ) ) ;
}
}
}
}
}
List < PaymentdocListVO > listVO = JsonUtil . getJsonToList ( list , PaymentdocListVO . class ) ;
List < PaymentdocListVO > listVO = JsonUtil . getJsonToList ( list , PaymentdocListVO . class ) ;
for ( PaymentdocListVO paymentdocVO : listVO ) {
for ( PaymentdocListVO paymentdocVO : listVO ) {
@ -164,6 +177,7 @@ public class PaymentdocController {
PaymentdocEntity entity = JsonUtil . getJsonToBean ( paymentdocCrForm , PaymentdocEntity . class ) ;
PaymentdocEntity entity = JsonUtil . getJsonToBean ( paymentdocCrForm , PaymentdocEntity . class ) ;
entity . setId ( mainId ) ;
entity . setId ( mainId ) ;
paymentdocService . save ( entity ) ;
paymentdocService . save ( entity ) ;
List < PaymentdocItem0Entity > PaymentdocItem0List = JsonUtil . getJsonToList ( paymentdocCrForm . getPaymentdocitem0List ( ) , PaymentdocItem0Entity . class ) ;
List < PaymentdocItem0Entity > PaymentdocItem0List = JsonUtil . getJsonToList ( paymentdocCrForm . getPaymentdocitem0List ( ) , PaymentdocItem0Entity . class ) ;
for ( PaymentdocItem0Entity entitys : PaymentdocItem0List ) {
for ( PaymentdocItem0Entity entitys : PaymentdocItem0List ) {
@ -171,6 +185,26 @@ public class PaymentdocController {
entitys . setPaymentdocId ( entity . getId ( ) ) ;
entitys . setPaymentdocId ( entity . getId ( ) ) ;
paymentdocItem0Service . save ( entitys ) ;
paymentdocItem0Service . save ( entitys ) ;
//修改采购订单为已付款申请
PurchaseorderEntity purchaseorderEntity = purchaseorderService . getById ( entitys . getPurchaseorderId ( ) ) ;
purchaseorderEntity . setIsPayment ( "1" ) ;
purchaseorderService . updateById ( purchaseorderEntity ) ;
}
List < PaymentdocItem1Entity > PaymentdocItem1List = JsonUtil . getJsonToList ( paymentdocCrForm . getPaymentdocitem1List ( ) , PaymentdocItem1Entity . class ) ;
for ( PaymentdocItem1Entity entitys : PaymentdocItem1List ) {
entitys . setId ( RandomUtil . uuId ( ) ) ;
entitys . setPaymentdocId ( entity . getId ( ) ) ;
paymentdocItem1Service . save ( entitys ) ;
}
List < PaymentdocItem2Entity > PaymentdocItem2List = JsonUtil . getJsonToList ( paymentdocCrForm . getPaymentdocitem2List ( ) , PaymentdocItem2Entity . class ) ;
for ( PaymentdocItem2Entity entitys : PaymentdocItem2List ) {
entitys . setId ( RandomUtil . uuId ( ) ) ;
entitys . setPaymentdocId ( entity . getId ( ) ) ;
paymentdocItem2Service . save ( entitys ) ;
}
}
if ( FlowStatusEnum . submit . getMessage ( ) . equals ( paymentdocCrForm . getStatus ( ) ) ) {
if ( FlowStatusEnum . submit . getMessage ( ) . equals ( paymentdocCrForm . getStatus ( ) ) ) {
try {
try {
@ -200,34 +234,137 @@ public class PaymentdocController {
PaymentdocInfoVO vo = JsonUtil . getJsonToBean ( entity , PaymentdocInfoVO . class ) ;
PaymentdocInfoVO vo = JsonUtil . getJsonToBean ( entity , PaymentdocInfoVO . class ) ;
//子表
//子表
List < String > purchaseorderIdList = new ArrayList < > ( ) ;
List < PurchaseorderEntity > purchaseorderEntityList = new ArrayList < > ( ) ;
List < PaymentdocItem0Entity > PaymentdocItem0List = paymentdocService . GetPaymentdocItem0List ( id ) ;
List < PaymentdocItem0Entity > PaymentdocItem0List = paymentdocService . GetPaymentdocItem0List ( id ) ;
List < PaymentdocItem0Model > list = JsonUtil . getJsonToList ( PaymentdocItem0List , PaymentdocItem0Model . class ) ;
for ( PaymentdocItem0Entity paymentdocitem0Entity : PaymentdocItem0List ) {
for ( PaymentdocItem0Model paymentdocItem0Model : list ) {
PurchaseorderEntity purchaseorderEntity = purchaseorderService . getById ( paymentdocitem0Entity . getPurchaseorderId ( ) ) ;
PurchaseorderEntity purchaseorderEntity = purchaseorderService . getById ( paymentdocItem0Model . getPurchaseorderId ( ) ) ;
if ( purchaseorderEntity ! = null & & StringUtils . isNotEmpty ( purchaseorderEntity . getContractCode ( ) ) ) {
if ( purchaseorderEntity ! = null & & StringUtils . isNotEmpty ( purchaseorderEntity . getContractCode ( ) ) ) {
ContractFileEntity contractFileEntity = contractFileService . getById ( purchaseorderEntity . getContractCode ( ) ) ;
ContractFileEntity contractFileEntity = contractFileService . getById ( purchaseorderEntity . getContractCode ( ) ) ;
if ( contractFileEntity ! = null & & StringUtils . isNotEmpty ( contractFileEntity . getContractName ( ) ) ) {
if ( contractFileEntity ! = null & & StringUtils . isNotEmpty ( contractFileEntity . getContractName ( ) ) ) {
purchaseorderEntity . setContractNo ( contractFileEntity . getContractCode ( ) ) ;
purchaseorderEntity . setContractNo ( contractFileEntity . getContractCode ( ) ) ;
}
}
}
}
paymentdoc Item0Model . setAllAmount ( purchaseorderEntity . getAmount ( ) ) ;
paymentdoc item0Entity . setAllAmount ( purchaseorderEntity . getAmount ( ) ) ;
paymentdoc Item0Model . setPayPrice ( purchaseorderEntity . getPayPrice ( ) ) ;
paymentdoc item0Entity . setPayPrice ( purchaseorderEntity . getPayPrice ( ) ) ;
paymentdoc Item0Model . setDocumentNo ( purchaseorderEntity . getDocumentNo ( ) ) ;
paymentdoc item0Entity . setDocumentNo ( purchaseorderEntity . getDocumentNo ( ) ) ;
paymentdoc Item0Model . setContractNo ( purchaseorderEntity . getContractNo ( ) ) ;
paymentdoc item0Entity . setContractNo ( purchaseorderEntity . getContractNo ( ) ) ;
paymentdoc Item0Model . setNum ( purchaseorderEntity . getNum ( ) ) ;
paymentdoc item0Entity . setNum ( purchaseorderEntity . getNum ( ) ) ;
paymentdoc Item0Model . setAdvanceAmount ( purchaseorderEntity . getAdvanceAmount ( ) ) ;
paymentdoc item0Entity . setAdvanceAmount ( purchaseorderEntity . getAdvanceAmount ( ) ) ;
paymentdoc Item0Model . setRate ( purchaseorderEntity . getRate ( ) ) ;
paymentdoc item0Entity . setRate ( purchaseorderEntity . getRate ( ) ) ;
paymentdoc Item0Model . setNotAmount ( purchaseorderEntity . getNotAmount ( ) ) ;
paymentdoc item0Entity . setNotAmount ( purchaseorderEntity . getNotAmount ( ) ) ;
paymentdoc Item0Model . setCreatorTime ( purchaseorderEntity . getCreatorTime ( ) ) ;
paymentdoc item0Entity . setCreatorTime ( purchaseorderEntity . getCreatorTime ( ) ) ;
}
}
vo . setPaymentdocItem0List ( list ) ;
vo . setPaymentdocItem0List ( JsonUtil . getJsonToList ( PaymentdocItem0List , PaymentdocItem0Model . class ) ) ;
List < PaymentdocItem1Entity > PaymentdocItem1List = paymentdocService . GetPaymentdocItem1List ( id ) ;
List < String > poundlistIdList = new ArrayList < > ( ) ;
for ( PaymentdocItem1Entity paymentdocitem1Entity : PaymentdocItem1List ) {
PurchaseorderEntity purchaseorderEntity = purchaseorderService . getById ( paymentdocitem1Entity . getPurchaseorderId ( ) ) ;
paymentdocitem1Entity . setPurchaseorderNo ( purchaseorderEntity . getDocumentNo ( ) ) ;
PoundlistEntity poundlistEntity = poundlistService . queryPoundById ( paymentdocitem1Entity . getPoundlistId ( ) ) ;
paymentdocitem1Entity . setVehicleName ( poundlistEntity . getVehicleName ( ) ) ;
paymentdocitem1Entity . setMaterialName ( poundlistEntity . getMaterialName ( ) ) ;
paymentdocitem1Entity . setPoundType ( poundlistEntity . getPoundType ( ) ) ;
paymentdocitem1Entity . setNetWeight ( poundlistEntity . getNetWeight ( ) ) ;
paymentdocitem1Entity . setUnit ( poundlistEntity . getUnit ( ) ) ;
paymentdocitem1Entity . setAdvance ( poundlistEntity . getAdvance ( ) ) ;
paymentdocitem1Entity . setPurchasePrice ( poundlistEntity . getPurchasePrice ( ) ) ;
paymentdocitem1Entity . setSettlement ( poundlistEntity . getSettlement ( ) ) ;
paymentdocitem1Entity . setRate ( poundlistEntity . getRate ( ) ) ;
paymentdocitem1Entity . setAmount ( poundlistEntity . getAmount ( ) ) ;
paymentdocitem1Entity . setNotAmount ( poundlistEntity . getNotAmount ( ) ) ;
paymentdocitem1Entity . setRemark ( poundlistEntity . getRemark ( ) ) ;
}
if ( poundlistIdList . size ( ) > 0 ) {
List < PoundlistEntity > poundlistEntityList = poundlistService . queryPoundListByIds ( poundlistIdList ) ;
vo . setPaymentdocItem1List ( JsonUtil . getJsonToList ( poundlistEntityList , PaymentdocItem1Model . class ) ) ;
} else {
vo . setPaymentdocItem1List ( JsonUtil . getJsonToList ( PaymentdocItem1List , PaymentdocItem1Model . class ) ) ;
}
List < PaymentdocItem2Entity > PaymentdocItem2List = paymentdocService . GetPaymentdocItem2List ( id ) ;
for ( PaymentdocItem2Entity paymentdocitem2Entity : PaymentdocItem2List ) {
}
vo . setPaymentdocItem2List ( JsonUtil . getJsonToList ( PaymentdocItem2List , PaymentdocItem2Model . class ) ) ;
QueryWrapper < PaymentEntity > PaymentqueryWrapper = new QueryWrapper < > ( ) ;
PaymentqueryWrapper . lambda ( ) . eq ( PaymentEntity : : getPaymentno , entity . getDocumentNo ( ) ) ;
List < PaymentEntity > paymentEntityList = paymentService . list ( PaymentqueryWrapper ) ;
vo . setPaymentEntityList ( paymentEntityList ) ;
//副表
//副表
return ActionResult . success ( vo ) ;
return ActionResult . success ( vo ) ;
}
}
/ * *
* 信 息
*
* @param id
* @return
* /
@GetMapping ( "paymentcocToPaymen/{id}" )
public ActionResult < PaymentdocInfoVO > paymentcocToPaymen ( @PathVariable ( "id" ) String id ) {
PaymentdocEntity entity = paymentdocService . getInfo ( id ) ;
PaymentdocInfoVO vo = JsonUtil . getJsonToBean ( entity , PaymentdocInfoVO . class ) ;
//子表
List < PaymentdocItem0Entity > PaymentdocItem0List = paymentdocService . GetPaymentdocItem0List ( id ) ;
for ( PaymentdocItem0Entity paymentdocitem0Entity : PaymentdocItem0List ) {
PurchaseorderEntity purchaseorderEntity = purchaseorderService . getById ( paymentdocitem0Entity . getPurchaseorderId ( ) ) ;
if ( purchaseorderEntity ! = null & & StringUtils . isNotEmpty ( purchaseorderEntity . getContractCode ( ) ) ) {
ContractFileEntity contractFileEntity = contractFileService . getById ( purchaseorderEntity . getContractCode ( ) ) ;
if ( contractFileEntity ! = null & & StringUtils . isNotEmpty ( contractFileEntity . getContractName ( ) ) ) {
purchaseorderEntity . setContractNo ( contractFileEntity . getContractCode ( ) ) ;
}
}
paymentdocitem0Entity . setRequestAmount ( paymentdocitem0Entity . getAmount ( ) ) ;
paymentdocitem0Entity . setAmount ( paymentdocitem0Entity . getAmount ( ) . subtract ( paymentdocitem0Entity . getPaymentAmount ( ) ) ) ;
paymentdocitem0Entity . setAllAmount ( purchaseorderEntity . getAmount ( ) ) ;
paymentdocitem0Entity . setPaymentAmount ( paymentdocitem0Entity . getPaymentAmount ( ) ) ;
paymentdocitem0Entity . setPayPrice ( purchaseorderEntity . getPayPrice ( ) ) ;
paymentdocitem0Entity . setDocumentNo ( purchaseorderEntity . getDocumentNo ( ) ) ;
paymentdocitem0Entity . setContractNo ( purchaseorderEntity . getContractNo ( ) ) ;
paymentdocitem0Entity . setNum ( purchaseorderEntity . getNum ( ) ) ;
paymentdocitem0Entity . setAdvanceAmount ( purchaseorderEntity . getAdvanceAmount ( ) ) ;
paymentdocitem0Entity . setRate ( purchaseorderEntity . getRate ( ) ) ;
paymentdocitem0Entity . setNotAmount ( purchaseorderEntity . getNotAmount ( ) ) ;
paymentdocitem0Entity . setCreatorTime ( purchaseorderEntity . getCreatorTime ( ) ) ;
}
vo . setPaymentdocItem0List ( JsonUtil . getJsonToList ( PaymentdocItem0List , PaymentdocItem0Model . class ) ) ;
List < PaymentdocItem1Entity > PaymentdocItem1List = paymentdocService . GetPaymentdocItem1List ( id ) ;
List < String > poundlistIdList = new ArrayList < > ( ) ;
for ( PaymentdocItem1Entity paymentdocitem1Entity : PaymentdocItem1List ) {
PurchaseorderEntity purchaseorderEntity = purchaseorderService . getById ( paymentdocitem1Entity . getPurchaseorderId ( ) ) ;
paymentdocitem1Entity . setPurchaseorderNo ( purchaseorderEntity . getDocumentNo ( ) ) ;
PoundlistEntity poundlistEntity = poundlistService . queryPoundById ( paymentdocitem1Entity . getPoundlistId ( ) ) ;
paymentdocitem1Entity . setVehicleName ( poundlistEntity . getVehicleName ( ) ) ;
paymentdocitem1Entity . setMaterialName ( poundlistEntity . getMaterialName ( ) ) ;
paymentdocitem1Entity . setPoundType ( poundlistEntity . getPoundType ( ) ) ;
paymentdocitem1Entity . setNetWeight ( poundlistEntity . getNetWeight ( ) ) ;
paymentdocitem1Entity . setUnit ( poundlistEntity . getUnit ( ) ) ;
paymentdocitem1Entity . setAdvance ( poundlistEntity . getAdvance ( ) ) ;
paymentdocitem1Entity . setPurchasePrice ( poundlistEntity . getPurchasePrice ( ) ) ;
paymentdocitem1Entity . setSettlement ( poundlistEntity . getSettlement ( ) ) ;
paymentdocitem1Entity . setRate ( poundlistEntity . getRate ( ) ) ;
paymentdocitem1Entity . setAmount ( poundlistEntity . getAmount ( ) ) ;
paymentdocitem1Entity . setNotAmount ( poundlistEntity . getNotAmount ( ) ) ;
paymentdocitem1Entity . setRemark ( poundlistEntity . getRemark ( ) ) ;
}
if ( poundlistIdList . size ( ) > 0 ) {
List < PoundlistEntity > poundlistEntityList = poundlistService . queryPoundListByIds ( poundlistIdList ) ;
vo . setPaymentdocItem1List ( JsonUtil . getJsonToList ( poundlistEntityList , PaymentdocItem1Model . class ) ) ;
} else {
vo . setPaymentdocItem1List ( JsonUtil . getJsonToList ( PaymentdocItem1List , PaymentdocItem1Model . class ) ) ;
}
List < PaymentdocItem2Entity > PaymentdocItem2List = paymentdocService . GetPaymentdocItem2List ( id ) ;
for ( PaymentdocItem2Entity paymentdocitem2Entity : PaymentdocItem2List ) {
}
vo . setPaymentdocItem2List ( JsonUtil . getJsonToList ( PaymentdocItem2List , PaymentdocItem2Model . class ) ) ;
QueryWrapper < PaymentEntity > PaymentqueryWrapper = new QueryWrapper < > ( ) ;
PaymentqueryWrapper . lambda ( ) . eq ( PaymentEntity : : getPaymentno , entity . getDocumentNo ( ) ) ;
List < PaymentEntity > paymentEntityList = paymentService . list ( PaymentqueryWrapper ) ;
vo . setPaymentEntityList ( paymentEntityList ) ;
//副表
return ActionResult . success ( vo ) ;
}
@ -262,15 +399,41 @@ public class PaymentdocController {
}
}
QueryWrapper < PaymentdocItem1Entity > PaymentdocItem1queryWrapper = new QueryWrapper < > ( ) ;
PaymentdocItem1queryWrapper . lambda ( ) . eq ( PaymentdocItem1Entity : : getPaymentdocId , entity . getId ( ) ) ;
paymentdocItem1Service . remove ( PaymentdocItem1queryWrapper ) ;
List < PaymentdocItem1Entity > PaymentdocItem1List = JsonUtil . getJsonToList ( paymentdocUpForm . getPaymentdocitem1List ( ) , PaymentdocItem1Entity . class ) ;
for ( PaymentdocItem1Entity entitys : PaymentdocItem1List ) {
entitys . setId ( RandomUtil . uuId ( ) ) ;
entitys . setPaymentdocId ( entity . getId ( ) ) ;
paymentdocItem1Service . save ( entitys ) ;
}
QueryWrapper < PaymentdocItem2Entity > PaymentdocItem2queryWrapper = new QueryWrapper < > ( ) ;
PaymentdocItem2queryWrapper . lambda ( ) . eq ( PaymentdocItem2Entity : : getPaymentdocId , entity . getId ( ) ) ;
paymentdocItem2Service . remove ( PaymentdocItem2queryWrapper ) ;
List < PaymentdocItem2Entity > PaymentdocItem2List = JsonUtil . getJsonToList ( paymentdocUpForm . getPaymentdocitem2List ( ) , PaymentdocItem2Entity . class ) ;
for ( PaymentdocItem2Entity entitys : PaymentdocItem2List ) {
entitys . setId ( RandomUtil . uuId ( ) ) ;
entitys . setPaymentdocId ( entity . getId ( ) ) ;
paymentdocItem2Service . save ( entitys ) ;
}
if ( FlowStatusEnum . submit . getMessage ( ) . equals ( paymentdocUpForm . getStatus ( ) ) ) {
if ( FlowStatusEnum . submit . getMessage ( ) . equals ( paymentdocUpForm . getStatus ( ) ) ) {
try {
try {
generaterSwapUtil . submitFlowTask ( visualdevEntity , id , subentity , userInfo , paymentdocUpForm . getCandidateList ( ) ) ;
generaterSwapUtil . submitFlowTask ( visualdevEntity , id , subentity , userInfo , paymentdocUpForm . getCandidateList ( ) ) ;
//提交流程,状态改为 1审批中
entity . setDocStatus ( "1" ) ;
paymentdocService . updateById ( entity ) ;
} catch ( WorkFlowException e ) {
} catch ( WorkFlowException e ) {
e . printStackTrace ( ) ;
e . printStackTrace ( ) ;
}
}
//提交流程,状态改为 1审批中
entity . setDocStatus ( "1" ) ;
paymentdocService . updateById ( entity ) ;
return ActionResult . success ( "提交成功,请耐心等待" ) ;
return ActionResult . success ( "提交成功,请耐心等待" ) ;
}
}
return ActionResult . success ( "更新成功" ) ;
return ActionResult . success ( "更新成功" ) ;
@ -301,11 +464,53 @@ public class PaymentdocController {
paymentdocService . delete ( entity ) ;
paymentdocService . delete ( entity ) ;
QueryWrapper < PaymentdocItem0Entity > queryWrapperPaymentdocItem0 = new QueryWrapper < > ( ) ;
QueryWrapper < PaymentdocItem0Entity > queryWrapperPaymentdocItem0 = new QueryWrapper < > ( ) ;
queryWrapperPaymentdocItem0 . lambda ( ) . eq ( PaymentdocItem0Entity : : getPaymentdocId , entity . getId ( ) ) ;
queryWrapperPaymentdocItem0 . lambda ( ) . eq ( PaymentdocItem0Entity : : getPaymentdocId , entity . getId ( ) ) ;
List < PaymentdocItem0Entity > list = paymentdocItem0Service . list ( queryWrapperPaymentdocItem0 ) ;
for ( PaymentdocItem0Entity paymentdocItem0Entity : list ) {
PurchaseorderEntity purchaseorderEntity = purchaseorderService . getById ( paymentdocItem0Entity . getPurchaseorderId ( ) ) ;
purchaseorderEntity . setIsPayment ( "0" ) ;
purchaseorderService . updateById ( purchaseorderEntity ) ;
}
paymentdocItem0Service . remove ( queryWrapperPaymentdocItem0 ) ;
paymentdocItem0Service . remove ( queryWrapperPaymentdocItem0 ) ;
QueryWrapper < PaymentdocItem1Entity > queryWrapperPaymentdocItem1 = new QueryWrapper < > ( ) ;
queryWrapperPaymentdocItem1 . lambda ( ) . eq ( PaymentdocItem1Entity : : getPaymentdocId , entity . getId ( ) ) ;
paymentdocItem1Service . remove ( queryWrapperPaymentdocItem1 ) ;
QueryWrapper < PaymentdocItem2Entity > queryWrapperPaymentdocItem2 = new QueryWrapper < > ( ) ;
queryWrapperPaymentdocItem2 . lambda ( ) . eq ( PaymentdocItem2Entity : : getPaymentdocId , entity . getId ( ) ) ;
paymentdocItem2Service . remove ( queryWrapperPaymentdocItem2 ) ;
}
}
return ActionResult . success ( "删除成功" ) ;
return ActionResult . success ( "删除成功" ) ;
}
}
/ * *
* 批 量 终 止
*
* @param ids
* @return
* /
@PostMapping ( "/batchtopPayment/{ids}" )
@Transactional
public ActionResult batchtopPayment ( @PathVariable ( "ids" ) String ids ) {
int i = 0 ;
String [ ] idList = ids . split ( "," ) ;
for ( String id : idList ) {
PaymentdocEntity paymentdocEntity = paymentdocService . getById ( id ) ;
paymentdocEntity . setIsStop ( "1" ) ;
paymentdocEntity . setIsSubmit ( "1" ) ;
paymentdocService . updateById ( paymentdocEntity ) ;
QueryWrapper < PaymentdocItem0Entity > queryWrapperPaymentdocItem0 = new QueryWrapper < > ( ) ;
queryWrapperPaymentdocItem0 . lambda ( ) . eq ( PaymentdocItem0Entity : : getPaymentdocId , id ) ;
List < PaymentdocItem0Entity > list = paymentdocItem0Service . list ( queryWrapperPaymentdocItem0 ) ;
for ( PaymentdocItem0Entity paymentdocItem0Entity : list ) {
PurchaseorderEntity purchaseorderEntity = purchaseorderService . getById ( paymentdocItem0Entity . getPurchaseorderId ( ) ) ;
purchaseorderEntity . setIsPayment ( "0" ) ;
purchaseorderService . updateById ( purchaseorderEntity ) ;
}
i + + ;
}
if ( i = = 0 ) {
return ActionResult . fail ( "终止失败" ) ;
}
return ActionResult . success ( "终止成功" ) ;
}
}
}