导入加时间和去掉批次生成

jg-waiwang-pro
XI_TENG\xixi_ 4 months ago
parent e5d83bcded
commit 1260b91dc4

@ -22,6 +22,9 @@ import jnpf.database.model.superQuery.ConditionJsonModel;
import jnpf.database.model.superQuery.SuperQueryConditionModel; import jnpf.database.model.superQuery.SuperQueryConditionModel;
import java.lang.reflect.Field; import java.lang.reflect.Field;
import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableField;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.util.regex.Pattern; import java.util.regex.Pattern;
import jnpf.model.QueryModel; import jnpf.model.QueryModel;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@ -1043,10 +1046,10 @@ public class VoucherServiceImpl extends ServiceImpl<VoucherMapper, VoucherEntity
voucherEntity.setVoucherType("3"); voucherEntity.setVoucherType("3");
} }
voucherEntity.setVoucherSource("1");//凭证来源 voucherEntity.setVoucherSource("1");//凭证来源
voucherEntity.setPoundlistTime(null);//磅单时间 // voucherEntity.setPoundlistTime(null);//磅单时间
voucherEntity.setAssociatedDocumentNo("");//关联单据号 voucherEntity.setAssociatedDocumentNo("");//关联单据号
voucherEntity.setPreparationTime(new Date());//制单时间 voucherEntity.setPreparationTime(new Date());//制单时间
voucherEntity.setPoundlistTime(new Date()); voucherEntity.setPoundlistTime(model.getPoundlistTime());//磅单时间
voucherEntity.setVoucherPictures(model.getVoucherPictures());//凭证图片 voucherEntity.setVoucherPictures(model.getVoucherPictures());//凭证图片
voucherEntity.setPoundCode(model.getPoundCode());//磅单编号 voucherEntity.setPoundCode(model.getPoundCode());//磅单编号
voucherEntity.setVehicleName(model.getVehicleName());//车牌号 voucherEntity.setVehicleName(model.getVehicleName());//车牌号

@ -677,7 +677,9 @@ public class WarehousingNotificationServiceImpl extends ServiceImpl<WarehousingN
for(WarehousingProductEntity entitys : tableField121){ for(WarehousingProductEntity entitys : tableField121){
entitys.setId(RandomUtil.uuId()); entitys.setId(RandomUtil.uuId());
entitys.setWarehousingId(entity.getId()); entitys.setWarehousingId(entity.getId());
entitys.setBatchNo(generaterSwapUtil.getBillNumber("batch", false)); if (entitys.getBatchNo()==null){
entitys.setBatchNo(generaterSwapUtil.getBillNumber("batch", false));
}
entitys.setProduceDate(new Date()); entitys.setProduceDate(new Date());
if(isSave){ if(isSave){
}else{ }else{

@ -166,7 +166,10 @@ public class BusinessOrderController {
} }
} }
if (entity.getProfit().compareTo(BigDecimal.ZERO) == 0){ if (entity.getProfit().compareTo(BigDecimal.ZERO) == 0){
purchaseAmount = voucherService.queryVoucherByBusinessOrderInfo1(entity.getId()); //采购订单总额 BigDecimal purchaseAmount1 = voucherService.queryVoucherByBusinessOrderInfo1(entity.getId()); //采购订单总额
entity.setProfit(saleAmount.subtract(purchaseAmount1));//利润
}
if (entity.getProfit().compareTo(BigDecimal.ZERO) <= 0){
entity.setProfit(saleAmount.subtract(purchaseAmount));//利润 entity.setProfit(saleAmount.subtract(purchaseAmount));//利润
} }

@ -1455,6 +1455,8 @@ public class VoucherController {
//List<VoucherExcelVO222> excelDataList = ExcelUtil.importExcel(temporary, 2, 1, VoucherExcelVO222.class); //List<VoucherExcelVO222> excelDataList = ExcelUtil.importExcel(temporary, 2, 1, VoucherExcelVO222.class);
// 导入字段 // 导入字段
List<ExcelImFieldModel> columns = new ArrayList<>(); List<ExcelImFieldModel> columns = new ArrayList<>();
// columns.add(new ExcelImFieldModel("poundlistTime","收货日期"));
columns.add(new ExcelImFieldModel("receivingDate","收货日期"));
columns.add(new ExcelImFieldModel("businessType","业务类型")); columns.add(new ExcelImFieldModel("businessType","业务类型"));
columns.add(new ExcelImFieldModel("documentType","单据类型")); columns.add(new ExcelImFieldModel("documentType","单据类型"));
columns.add(new ExcelImFieldModel("voucherType","凭证类型")); columns.add(new ExcelImFieldModel("voucherType","凭证类型"));
@ -1500,6 +1502,13 @@ public class VoucherController {
tableField140columns.add(new ExcelImFieldModel("telephone" ,"联系电话")); tableField140columns.add(new ExcelImFieldModel("telephone" ,"联系电话"));
tableField140columns.add(new ExcelImFieldModel("carrier" ,"承运商")); tableField140columns.add(new ExcelImFieldModel("carrier" ,"承运商"));
columns.add(new ExcelImFieldModel("tableField140","",tableField140columns));*/ columns.add(new ExcelImFieldModel("tableField140","",tableField140columns));*/
for (VoucherExcelVO222 voucherExcelVO222:excelDataList){
String a= String.valueOf(voucherExcelVO222.getPoundlistTime());
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
Date date = new Date(a);
String formattedDate = sdf.format(date);
voucherExcelVO222.setReceivingDate(formattedDate);
}
headAndDataMap.put("dataRow" , JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(excelDataList))); headAndDataMap.put("dataRow" , JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(excelDataList)));
headAndDataMap.put("headerRow" , JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(columns))); headAndDataMap.put("headerRow" , JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(columns)));
} catch (Exception e){ } catch (Exception e){

@ -9,6 +9,7 @@ import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data; import lombok.Data;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.Date;
import java.util.List; import java.util.List;
/** /**
@ -21,14 +22,16 @@ import java.util.List;
*/ */
@Data @Data
public class VoucherExcelVO222 { public class VoucherExcelVO222 {
@Excel(name = "收货日期" )
private Date poundlistTime;
@Excel(name = "凭证类型") @Excel(name = "凭证类型")
private String voucherType; private String voucherType;
@Excel(name = "单据类型") @Excel(name = "单据类型")
private String documentType; private String documentType;
@Excel(name = "业务类型") @Excel(name = "业务类型")
private String businessType; private String businessType;
/*@Excel(name = "收货日期" ) @Excel(name = "收货日期11" )
private String receivingDate;*/ private String receivingDate;
@Excel(name = "商品名称" ) @Excel(name = "商品名称" )
private String productName; private String productName;
@Excel(name = "送货车号" ) @Excel(name = "送货车号" )

@ -36,7 +36,8 @@
<div class="import-main" v-show="active==2"> <div class="import-main" v-show="active==2">
<JNPF-table v-loading="listLoading" :data="list" :span-method="arraySpanMethod"> <JNPF-table v-loading="listLoading" :data="list" :span-method="arraySpanMethod">
<el-table-column :prop="item.id" :label="item.fullName" min-width="300" <el-table-column :prop="item.id" :label="item.fullName" min-width="300"
v-for="(item,index) in headerList" :key="index" :align="item.children?'center':'left'" v-if="item.id != 'vehiclePictures'"> v-for="(item,index) in headerList" :key="index" :align="item.children?'center':'left'"
v-if="item.id != 'vehiclePictures'">
<template slot-scope="scope" v-if="!item.children"> <template slot-scope="scope" v-if="!item.children">
<el-input v-model="scope.row[item.id]" v-if="item.id != 'productName' && item.id != 'voucherPictures' <el-input v-model="scope.row[item.id]" v-if="item.id != 'productName' && item.id != 'voucherPictures'
&& item.id != 'vehiclePictures'" /> && item.id != 'vehiclePictures'" />
@ -47,18 +48,15 @@
:style='{"width":"100%"}' hasPage> :style='{"width":"100%"}' hasPage>
</JnpfPopupSelect> --> </JnpfPopupSelect> -->
<el-input <el-input v-model="scope.row['productName']" readonly :validate-event="false"
v-model="scope.row['productName']" :disabled="true" v-if="item.id == 'productName'">
readonly <el-button slot="append" icon="el-icon-search"
:validate-event="false" @click="choice(scope.row, scope.$index)"></el-button>
:disabled="true"
v-if="item.id == 'productName'"
>
<el-button slot="append" icon="el-icon-search" @click="choice(scope.row, scope.$index)"></el-button>
</el-input> </el-input>
<JnpfUploadImg v-model="scope.row['voucherPictures1']" :disabled="true" v-if="item.id == 'voucherPictures'" <JnpfUploadImg v-model="scope.row['voucherPictures1']" :disabled="true"
:fileSize="10" sizeUnit="MB" :limit="1" pathType="defaultPath" :isAccount="0"> v-if="item.id == 'voucherPictures'" :fileSize="10" sizeUnit="MB" :limit="1"
pathType="defaultPath" :isAccount="0">
</JnpfUploadImg> </JnpfUploadImg>
<!-- <JnpfUploadImg v-model="scope.row['vehiclePictures1']" :disabled="true" v-if="item.id == 'vehiclePictures'" <!-- <JnpfUploadImg v-model="scope.row['vehiclePictures1']" :disabled="true" v-if="item.id == 'vehiclePictures'"
:fileSize="10" sizeUnit="MB" :limit="10" pathType="defaultPath" :isAccount="0"> :fileSize="10" sizeUnit="MB" :limit="10" pathType="defaultPath" :isAccount="0">
@ -91,7 +89,8 @@
interfaceId="529919666429100229" :pageSize="20" :columnOptions="productIdcolumnOptions" clearable interfaceId="529919666429100229" :pageSize="20" :columnOptions="productIdcolumnOptions" clearable
:style='{"width":"100%"}' hasPage> :style='{"width":"100%"}' hasPage>
</JnpfPopupSelect> --> </JnpfPopupSelect> -->
<el-button v-if="obj.id=='delete'" size="mini" type="text" class="JNPF-table-delBtn" <el-button v-if="obj.id=='delete'" size="mini" type="text"
class="JNPF-table-delBtn"
@click="handleTableDel(scope.$index,j,item)">删除</el-button> @click="handleTableDel(scope.$index,j,item)">删除</el-button>
</td> </td>
</tr> </tr>
@ -101,15 +100,13 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :prop="item.id" :label="item.fullName" min-width="1300" <el-table-column :prop="item.id" :label="item.fullName" min-width="1300"
v-for="(item,index) in headerList" :key="index" :align="item.children?'center':'left'" v-if="item.id == 'vehiclePictures'"> v-for="(item,index) in headerList" :key="index" :align="item.children?'center':'left'"
v-if="item.id == 'vehiclePictures'">
<template slot-scope="scope" v-if="!item.children"> <template slot-scope="scope" v-if="!item.children">
<JnpfUploadImg v-model="scope.row['vehiclePictures1']" :disabled="true" v-if="item.id == 'vehiclePictures'" <JnpfUploadImg v-model="scope.row['vehiclePictures1']" :disabled="true"
:fileSize="10" sizeUnit="MB" :limit="10" pathType="defaultPath" :isAccount="0"> v-if="item.id == 'vehiclePictures'" :fileSize="10" sizeUnit="MB" :limit="10"
pathType="defaultPath" :isAccount="0">
</JnpfUploadImg> </JnpfUploadImg>
</template> </template>
<template v-if="item.children"> <template v-if="item.children">
@ -123,7 +120,8 @@
<td v-for="(obj,k) in item.children" :key="k" <td v-for="(obj,k) in item.children" :key="k"
:class="obj.id=='delete'?'delete':'td-flex-1 m-0-10'"> :class="obj.id=='delete'?'delete':'td-flex-1 m-0-10'">
<el-input v-model="row[obj.id]" v-if="obj.id!='delete'" /> <el-input v-model="row[obj.id]" v-if="obj.id!='delete'" />
<el-button v-if="obj.id=='delete'" size="mini" type="text" class="JNPF-table-delBtn" <el-button v-if="obj.id=='delete'" size="mini" type="text"
class="JNPF-table-delBtn"
@click="handleTableDel(scope.$index,j,item)">删除</el-button> @click="handleTableDel(scope.$index,j,item)">删除</el-button>
</td> </td>
</tr> </tr>
@ -218,8 +216,8 @@
</template> </template>
<script> <script>
import { Download } from '@/api/extend/document' import { Download } from '@/api/extend/document'
import ProductRadioGoodsBox from '@/views/extend/customer/subjectbasic/ProductRadioGoodsBox' import ProductRadioGoodsBox from '@/views/extend/customer/subjectbasic/ProductRadioGoodsBox'
import { getTemplateDownload, getImportPreview, importData, getImportExceptionData } from '@/api/common' import { getTemplateDownload, getImportPreview, importData, getImportExceptionData } from '@/api/common'
export default { export default {
components: { ProductRadioGoodsBox }, components: { ProductRadioGoodsBox },
@ -275,7 +273,7 @@ export default {
}, { }, {
"label": "配送方式", "label": "配送方式",
"value": "deliveryTypeName" "value": "deliveryTypeName"
}, ], },],
flowListVisible: false flowListVisible: false
} }
}, },
@ -286,9 +284,9 @@ export default {
this.$refs.goodsBox.init(row.productName, index) this.$refs.goodsBox.init(row.productName, index)
}) })
}, },
initList(list,index) { initList(list, index) {
this.list.forEach(item => { this.list.forEach(item => {
if(item.productName == list.name){ if (item.productName == list.name) {
item.productId = list.id; item.productId = list.id;
} }
}) })
@ -296,13 +294,13 @@ export default {
this.list[index].productId = list.id; this.list[index].productId = list.id;
this.list[index].productName = list.name; */ this.list[index].productName = list.name; */
}, },
productChangeData(model, row){ productChangeData(model, row) {
}, },
init(modelId, url, enableFlow, flowList, businessType, documentType) { init(modelId, url, enableFlow, flowList, businessType, documentType) {
if(businessType && businessType != ''){ if (businessType && businessType != '') {
this.uploadObjs.businessType = businessType this.uploadObjs.businessType = businessType
} }
if(documentType && documentType != ''){ if (documentType && documentType != '') {
this.uploadObjs.documentType = documentType this.uploadObjs.documentType = documentType
} }
this.active = 1 this.active = 1
@ -359,35 +357,35 @@ export default {
} }
let flag = false let flag = false
let index = 0 let index = 0
for(let i=0;i<this.list.length; i++){ for (let i = 0; i < this.list.length; i++) {
if(!this.list[i].productId){ if (!this.list[i].productId) {
flag = true flag = true
index = i+1 index = i + 1
} }
} }
if(!flag){ if (!flag) {
}else{ } else {
this.$message({ this.$message({
type: 'error', type: 'error',
message: '请选择第'+ index + '行的商品', message: '请选择第' + index + '行的商品',
duration: 1500, duration: 1500,
}) })
return return
} }
let flag1 = false let flag1 = false
let index1 = 0 let index1 = 0
for(let i=0;i<this.list.length; i++){ for (let i = 0; i < this.list.length; i++) {
if(!this.list[i].buckleWeight || !this.list[i].freight || !this.list[i].grossWeight || !this.list[i].netWeight || !this.list[i].purchaseAmount || !this.list[i].saleAmount || !this.list[i].tareWeight){ if (!this.list[i].buckleWeight || !this.list[i].freight || !this.list[i].grossWeight || !this.list[i].netWeight || !this.list[i].purchaseAmount || !this.list[i].saleAmount || !this.list[i].tareWeight) {
flag1 = true flag1 = true
index1 = i+1 index1 = i + 1
} }
} }
if(!flag1){ if (!flag1) {
this.handleSubmit() this.handleSubmit()
}else{ } else {
this.$message({ this.$message({
type: 'error', type: 'error',
message: '第'+ index1 + '行的数字金额不能为空可以填0', message: '第' + index1 + '行的数字金额不能为空可以填0',
duration: 1500, duration: 1500,
}) })
return return
@ -398,11 +396,11 @@ export default {
this.btnLoading = true this.btnLoading = true
getImportPreview(this.modelId, { fileName: this.fileName }, this.url).then(res => { getImportPreview(this.modelId, { fileName: this.fileName }, this.url).then(res => {
this.list = res.data.dataRow this.list = res.data.dataRow
for(let i=0;i<this.list.length; i++){ for (let i = 0; i < this.list.length; i++) {
if(this.list[i].voucherPictures && this.list[i].voucherPictures != ''){ if (this.list[i].voucherPictures && this.list[i].voucherPictures != '') {
this.list[i].voucherPictures1 = JSON.parse(this.list[i].voucherPictures) this.list[i].voucherPictures1 = JSON.parse(this.list[i].voucherPictures)
} }
if(this.list[i].vehiclePictures && this.list[i].vehiclePictures != ''){ if (this.list[i].vehiclePictures && this.list[i].vehiclePictures != '') {
this.list[i].vehiclePictures1 = JSON.parse(this.list[i].vehiclePictures) this.list[i].vehiclePictures1 = JSON.parse(this.list[i].vehiclePictures)
} }
} }

@ -39,10 +39,8 @@
</el-table-column> </el-table-column>
<el-table-column prop="warehouseName" label="入库仓库" align="center" width="150"> <el-table-column prop="warehouseName" label="入库仓库" align="center" width="150">
</el-table-column> </el-table-column>
<el-table-column prop="orderCode" label="关联采购单号" align="center" width="200"> <el-table-column prop="orderCode" label="关联采购(销售)单号" align="center" width="200">
</el-table-column> </el-table-column>
<el-table-column prop="skuNum" label="商品数" align="center" width="200"> <el-table-column prop="skuNum" label="商品数" align="center" width="200">
</el-table-column> </el-table-column>
<el-table-column prop="voucherNum" label="凭证数" align="center" width="200"> <el-table-column prop="voucherNum" label="凭证数" align="center" width="200">

@ -1234,7 +1234,7 @@ export default {
}, },
methods: { methods: {
getSummaries(param) { getSummaries(param) {
const summaryField = ["saleNum", "grossWeight", "tareWeight", "buckleWeight", "netWeight", "clearWeight", "deliveryNum", "taxCount", "notTaxCount"]; const summaryField = ["saleNum", "grossWeight", "tareWeight", "buckleWeight", "netWeight", "clearWeight", "deliveryNum", "inventoryNo", "taxCount", "notTaxCount"];
const { columns, data } = param; const { columns, data } = param;
const sums = []; const sums = [];
columns.forEach((column, index) => { columns.forEach((column, index) => {

Loading…
Cancel
Save