Merge remote-tracking branch 'origin/main'

product
chuang 2 years ago
commit b79a452034

@ -24,6 +24,7 @@ import jnpf.poundlist.service.PoundlistService;
import jnpf.purchaseback.entity.PurchaseorderEntity;
import jnpf.purchaseback.service.PurchaseorderService;
import jnpf.purchaseorder.entity.Purchaseorder_item0Entity;
import jnpf.purchaseorder.service.Purchaseorder_item0Service;
import jnpf.purchaseorder.service.PurchaseorderitemService;
import jnpf.supplier.entity.SupplierEntity;
import jnpf.supplier.service.SupplierService;
@ -57,6 +58,7 @@ import jnpf.util.GeneraterSwapUtil;
import java.math.BigDecimal;
import java.util.*;
import java.util.stream.Collectors;
import jnpf.util.file.UploadUtil;
import jnpf.util.enums.FileTypeEnum;
@ -103,6 +105,8 @@ public class InvoicesController {
private ContractFileService contractFileService;
@Autowired
private SupplierService supplierService;
@Autowired
private Purchaseorder_item0Service purchaseorder_item0Service;
/**
*
*
@ -143,20 +147,20 @@ public class InvoicesController {
@PostMapping
@Transactional
public ActionResult create(@RequestBody @Valid InvoicesCrForm invoicesCrForm) throws DataException {
String mainId =RandomUtil.uuId();
UserInfo userInfo=userProvider.get();
String mainId = RandomUtil.uuId();
UserInfo userInfo = userProvider.get();
//invoicesCrForm.setDocumentNo(generaterSwapUtil.getBillNumber("yffp", false));
InvoicesEntity entity = JsonUtil.getJsonToBean(invoicesCrForm, InvoicesEntity.class);
entity.setId(mainId);
invoicesService.save(entity);
List<InvoicesItem1Entity> InvoicesItem1List = JsonUtil.getJsonToList(invoicesCrForm.getInvoicesitem1List(),InvoicesItem1Entity.class);
for(InvoicesItem1Entity entitys : InvoicesItem1List){
List<InvoicesItem1Entity> InvoicesItem1List = JsonUtil.getJsonToList(invoicesCrForm.getInvoicesitem1List(), InvoicesItem1Entity.class);
for (InvoicesItem1Entity entitys : InvoicesItem1List) {
entitys.setId(RandomUtil.uuId());
entitys.setInvoicesId(entity.getId());
invoicesItem1Service.save(entitys);
}
List<InvoicesItem0Entity> InvoicesItem0List = JsonUtil.getJsonToList(invoicesCrForm.getInvoicesitem0List(),InvoicesItem0Entity.class);
for(InvoicesItem0Entity entitys : InvoicesItem0List){
List<InvoicesItem0Entity> InvoicesItem0List = JsonUtil.getJsonToList(invoicesCrForm.getInvoicesitem0List(), InvoicesItem0Entity.class);
for (InvoicesItem0Entity entitys : InvoicesItem0List) {
entitys.setId(RandomUtil.uuId());
entitys.setInvoicesId(entity.getId());
invoicesItem0Service.save(entitys);
@ -167,29 +171,38 @@ public class InvoicesController {
purchaseorderEntity.setInvoiceAmount(entity.getInvoiceAmount());
purchaseorderEntity.setInvoiceNum(entity.getInvoiceQuantity());
purchaseorderService.updateById(purchaseorderEntity);
List<Purchaseorder_item0Entity> Purchaseorder_item0List = purchaseorderitemService.GetPurchaseorder_item0List(entity.getPurchaseorderId());
List<PoundlistEntity> poundlistEntityList = purchaseorderitemService.getPoundList(entity.getPurchaseorderId());
if (purchaseorderEntity.getAmount().compareTo(entity.getInvoiceAmount()) == 0) {
for (PoundlistEntity poundlistEntity: poundlistEntityList) {
poundlistEntity.setIsInvoicing("1");
poundlistEntity.setInputDate(new Date());
}
poundlistService.updateBatchById(poundlistEntityList);
}else {
Purchaseorder_item0Entity orderItem = Purchaseorder_item0List.stream().filter(item0 -> ObjectUtil.equals(item0.getPoundlistId(), poundlistEntityList.get(0).getId())).findAny().get();
BigDecimal total = orderItem.getAmount();
int i = 0;
while (entity.getInvoiceAmount().compareTo(total) >= 0){
while (entity.getInvoiceAmount().compareTo(total) >= 0) {
i++;
if(i < poundlistEntityList.size()){
if (i < poundlistEntityList.size()) {
String poundlistId = poundlistEntityList.get(i).getId();
orderItem = Purchaseorder_item0List.stream().filter(item0 -> ObjectUtil.equals(item0.getPoundlistId(), poundlistId)).findAny().get();
total = total.add(orderItem.getAmount());
}else{
} else {
break;
}
}
for (int j = 0;j<poundlistEntityList.size();j++) {
if(j < i){
for (int j = 0; j < poundlistEntityList.size(); j++) {
if (j < i) {
poundlistEntityList.get(j).setIsInvoicing("1");
poundlistEntityList.get(j).setInputDate(new Date());
}
poundlistEntityList.get(j).setPurchaseStatus("1");
poundlistService.updateById(poundlistEntityList.get(j));
}
}
return ActionResult.success("创建成功");
}

@ -3,8 +3,8 @@
<PortalLayoutB :layout="layout" v-if="type === 0" />
<div class="sale">
<div class="sale_title">
<span> 今日磅单指数</span>
<span>磅单实时交易情况</span>
<span>今日经营指数</span>
<span>实时交易情况</span>
</div>
<ul class="sale_items">
<li>
@ -50,14 +50,6 @@
<line-chart-b />
</el-col>
</el-row>
<!-- <el-row style="background:#fff;padding:0 16px;margin-bottom:10px;border-radius: 4px;">
<div class="dateSelect">
<el-date-picker v-model="value1" type="date" placeholder="选择日期" size="small">
</el-date-picker>
</div>
<line-chart />
</el-row> -->
<!-- <PortalLayoutC :layout="layout" v-if="type === 0" /> -->
<el-row :gutter="10" class="notice">
<el-col :span="12">
<div class="notice_left">
@ -120,6 +112,9 @@ export default {
opinionData: ["3", "2", "4", "4", "5"],
massageList: [],
tadayPoundist: {},
pageSize: 10,
currentPage: 1,
intervalID: undefined,
}
},
computed: {
@ -133,6 +128,10 @@ export default {
this.getTadayPoundist()
this.getData()
this.getMsg()
this.intervalStrat()
},
beforeDestroy() {
this.intervalDel();
},
methods: {
getData() {
@ -157,18 +156,35 @@ export default {
url: "/api/messageCenter/MessageCenter/getMobileList",
method: "post",
data: {
currentPage: 1,
pageSize: 9,
currentPage: this.currentPage,
pageSize: this.pageSize,
},
}).then(res => {
if (res.code == 200) {
let _list = res.data.list;
this.massageList = _list;
if (this.massageList.length === this.pageSize) {
this.currentPage = this.currentPage + 1;
} else {
this.currentPage = 1;
}
//console.log(_list)
}
}).catch(() => {
})
},
intervalStrat() {
this.intervalDel();
this.intervalID = setInterval(() => {
this.getMsg();
}, 5000);
},
intervalDel() {
if (this.intervalID) {
clearInterval(this.intervalID);
}
},
getTadayPoundist() {
request({
url: "/api/messageCenter/MessageCenter/getTadayPoundist",

Loading…
Cancel
Save