|
|
|
@ -23,8 +23,6 @@ import jnpf.base.controller.BillRuleController;
|
|
|
|
|
import jnpf.base.entity.ProvinceEntity;
|
|
|
|
|
import jnpf.base.mapper.ProvinceMapper;
|
|
|
|
|
import jnpf.config.ConfigValueUtil;
|
|
|
|
|
import jnpf.contractfile.entity.ContractFileEntity;
|
|
|
|
|
import jnpf.contractfile.service.ContractFileService;
|
|
|
|
|
import jnpf.customer.entity.CustomerEntity;
|
|
|
|
|
import jnpf.customer.mapper.CustomerVMapper;
|
|
|
|
|
import jnpf.exception.DataException;
|
|
|
|
@ -77,6 +75,7 @@ import java.awt.*;
|
|
|
|
|
import java.io.*;
|
|
|
|
|
import java.lang.reflect.Field;
|
|
|
|
|
import java.math.BigDecimal;
|
|
|
|
|
import java.math.RoundingMode;
|
|
|
|
|
import java.net.URLEncoder;
|
|
|
|
|
import java.text.ParseException;
|
|
|
|
|
import java.text.SimpleDateFormat;
|
|
|
|
@ -85,7 +84,6 @@ import java.util.*;
|
|
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
*
|
|
|
|
|
* purchaseorder
|
|
|
|
|
* 版本: V3.2.0
|
|
|
|
|
* 版权: LINKAGE-BOOT
|
|
|
|
@ -231,7 +229,6 @@ public class PurchaseorderitemServiceImpl extends ServiceImpl<PurchaseorderitemM
|
|
|
|
|
sheet.addMergedRegion(new CellRangeAddress(1, 1, 0, 8));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
BigDecimal sum = BigDecimal.ZERO;
|
|
|
|
|
if (list != null && list.size() > 0) {
|
|
|
|
|
for (int i = 0; i < list.size(); i++) {
|
|
|
|
@ -342,7 +339,7 @@ public class PurchaseorderitemServiceImpl extends ServiceImpl<PurchaseorderitemM
|
|
|
|
|
HSSFCell lowCell2 = lowRow.createCell(8);
|
|
|
|
|
lowCell1.setCellValue("合计");
|
|
|
|
|
lowCell1.setCellStyle(lineStyle);
|
|
|
|
|
sum.setScale(2,BigDecimal.ROUND_DOWN);
|
|
|
|
|
sum.setScale(2, RoundingMode.DOWN);
|
|
|
|
|
lowCell2.setCellValue(sum.toString());
|
|
|
|
|
lowCell2.setCellStyle(lineStyle);
|
|
|
|
|
lowRow.createCell(1).setCellStyle(lineStyle);
|
|
|
|
@ -367,13 +364,13 @@ public class PurchaseorderitemServiceImpl extends ServiceImpl<PurchaseorderitemM
|
|
|
|
|
sheet.autoSizeColumn(8);
|
|
|
|
|
sheet.setAutobreaks(true);//这个是sheet缩放设置,默认打印一页要true
|
|
|
|
|
|
|
|
|
|
sheet.setMargin(Sheet.BottomMargin,( double ) 0.5 );// 页边距(下)
|
|
|
|
|
sheet.setMargin(Sheet.BottomMargin, 0.5);// 页边距(下)
|
|
|
|
|
|
|
|
|
|
sheet.setMargin(Sheet.LeftMargin,( double ) 0.1 );// 页边距(左)
|
|
|
|
|
sheet.setMargin(Sheet.LeftMargin, 0.1);// 页边距(左)
|
|
|
|
|
|
|
|
|
|
sheet.setMargin(Sheet.RightMargin,( double ) 0.1 );// 页边距(右)
|
|
|
|
|
sheet.setMargin(Sheet.RightMargin, 0.1);// 页边距(右)
|
|
|
|
|
|
|
|
|
|
sheet.setMargin(Sheet.TopMargin,( double ) 0.5 );// 页边距(上)
|
|
|
|
|
sheet.setMargin(Sheet.TopMargin, 0.5);// 页边距(上)
|
|
|
|
|
|
|
|
|
|
sheet.setHorizontallyCenter(true);//设置打印页面为水平居中
|
|
|
|
|
|
|
|
|
@ -386,7 +383,6 @@ public class PurchaseorderitemServiceImpl extends ServiceImpl<PurchaseorderitemM
|
|
|
|
|
sheet.setFitToPage(true);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
HSSFPrintSetup printSetup = sheet.getPrintSetup();
|
|
|
|
|
|
|
|
|
|
printSetup.setLandscape(false); // 打印方向,true:横向,false:纵向
|
|
|
|
@ -394,8 +390,6 @@ public class PurchaseorderitemServiceImpl extends ServiceImpl<PurchaseorderitemM
|
|
|
|
|
printSetup.setPaperSize(HSSFPrintSetup.A4_PAPERSIZE); //纸张大小,自选A4 作者:大萌音音 https://www.bilibili.com/read/cv15053559 出处:bilibili
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
workbook.write(fileOut);
|
|
|
|
|
|
|
|
|
|
} finally {
|
|
|
|
@ -411,7 +405,6 @@ public class PurchaseorderitemServiceImpl extends ServiceImpl<PurchaseorderitemM
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
*
|
|
|
|
|
* @param wrapper 条件构造器
|
|
|
|
|
* @param templateFilePath 临时文件路径
|
|
|
|
|
* @throws Exception
|
|
|
|
@ -462,10 +455,10 @@ public class PurchaseorderitemServiceImpl extends ServiceImpl<PurchaseorderitemM
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
*@TODO 在临时路径生成word文件
|
|
|
|
|
* @param list word信息的数组
|
|
|
|
|
* @param templateFilePath 临时路径
|
|
|
|
|
* @throws Exception
|
|
|
|
|
* @TODO 在临时路径生成word文件
|
|
|
|
|
*/
|
|
|
|
|
public void getWord(List<HashMap<String, Object>> list, String templateFilePath) throws Exception {
|
|
|
|
|
// 创建一个新的word文件
|
|
|
|
@ -491,7 +484,7 @@ public class PurchaseorderitemServiceImpl extends ServiceImpl<PurchaseorderitemM
|
|
|
|
|
HashMap<String, Object> map = list.get(i);
|
|
|
|
|
if (i == 0) {
|
|
|
|
|
Paragraph title = section.addParagraph();
|
|
|
|
|
title.appendText(String.valueOf(map.get("supplierName")+"榜单图片"));
|
|
|
|
|
title.appendText(map.get("supplierName") + "榜单图片");
|
|
|
|
|
titleStr = String.valueOf(map.get("supplierName"));
|
|
|
|
|
title.getFormat().setHorizontalAlignment(HorizontalAlignment.Center);
|
|
|
|
|
|
|
|
|
@ -604,9 +597,9 @@ if (pMap!=null&&pMap.size()>0){
|
|
|
|
|
// log.warn("报错点"+model.getAmount().equals("null"));
|
|
|
|
|
settlementSum = settlementSum.add(new BigDecimal(model.getSettlement() == null ? "0.00000000" : model.getSettlement()));
|
|
|
|
|
amountSum = amountSum.add(new BigDecimal(model.getAmount() == null ? "0.00000000" : model.getAmount()));
|
|
|
|
|
model.setSettlement(new BigDecimal(model.getSettlement()).setScale(2,BigDecimal.ROUND_HALF_DOWN).toString());
|
|
|
|
|
model.setPrice(new BigDecimal(model.getPrice()).setScale(2,BigDecimal.ROUND_HALF_DOWN).toString());
|
|
|
|
|
model.setAmount(new BigDecimal(model.getAmount()==null?"0.00000000":model.getAmount()).setScale(2,BigDecimal.ROUND_HALF_DOWN).toString());
|
|
|
|
|
model.setSettlement(new BigDecimal(model.getSettlement()).setScale(2, RoundingMode.HALF_DOWN).toString());
|
|
|
|
|
model.setPrice(new BigDecimal(model.getPrice()).setScale(2, RoundingMode.HALF_DOWN).toString());
|
|
|
|
|
model.setAmount(new BigDecimal(model.getAmount() == null ? "0.00000000" : model.getAmount()).setScale(2, RoundingMode.HALF_DOWN).toString());
|
|
|
|
|
// 客户名称
|
|
|
|
|
String supplierNm = model.getSupplierNm();
|
|
|
|
|
imgMap.put("supplierNm", supplierNm);
|
|
|
|
@ -626,7 +619,7 @@ if (pMap!=null&&pMap.size()>0){
|
|
|
|
|
Section section = document.addSection();
|
|
|
|
|
|
|
|
|
|
Paragraph title = section.addParagraph();
|
|
|
|
|
title.appendText(String.valueOf(map.get("supplierName")+"榜单图片"));
|
|
|
|
|
title.appendText(map.get("supplierName") + "榜单图片");
|
|
|
|
|
ParagraphStyle style = new ParagraphStyle(document);
|
|
|
|
|
style.setName("titleStyle");
|
|
|
|
|
style.getCharacterFormat().setBold(true);
|
|
|
|
@ -651,7 +644,7 @@ if (pMap!=null&&pMap.size()>0){
|
|
|
|
|
for (int i1 = 0; i1 < pictures1.size(); i1++) {
|
|
|
|
|
Map<String, Object> map2 = pictures1.get(i1);
|
|
|
|
|
if (map2.get("filePath") != null && !String.valueOf(map2.get("filePath")).equals("null")) {
|
|
|
|
|
log.warn("路径"+(String)map2.get("filePath"));
|
|
|
|
|
log.warn("路径" + map2.get("filePath"));
|
|
|
|
|
// 添加一个段落
|
|
|
|
|
Paragraph paragraph1 = section.addParagraph();
|
|
|
|
|
paragraph1.appendText(String.valueOf(map1.get("supplierNm")));
|
|
|
|
@ -660,10 +653,10 @@ if (pMap!=null&&pMap.size()>0){
|
|
|
|
|
|
|
|
|
|
DocPicture pic = paragraph.appendPicture((String) map2.get("filePath"));
|
|
|
|
|
if (map2.get("width") != null) {
|
|
|
|
|
pic.setWidth(Float.valueOf(String.valueOf(map2.get("width")+"f")));
|
|
|
|
|
pic.setWidth(Float.valueOf(map2.get("width") + "f"));
|
|
|
|
|
}
|
|
|
|
|
if (map2.get("height") != null) {
|
|
|
|
|
pic.setHeight(Float.valueOf(String.valueOf(map2.get("height")+"f")));
|
|
|
|
|
pic.setHeight(Float.valueOf(map2.get("height") + "f"));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -671,8 +664,8 @@ if (pMap!=null&&pMap.size()>0){
|
|
|
|
|
}
|
|
|
|
|
//生成word文档
|
|
|
|
|
document.saveToFile(templateFilePath + "doc.docx", FileFormat.Docx_2013);
|
|
|
|
|
map.put("settlementSum",settlementSum.setScale(2,BigDecimal.ROUND_HALF_DOWN).toString());
|
|
|
|
|
map.put("amountSum",amountSum.setScale(2,BigDecimal.ROUND_HALF_DOWN).toString() );
|
|
|
|
|
map.put("settlementSum", settlementSum.setScale(2, RoundingMode.HALF_DOWN).toString());
|
|
|
|
|
map.put("amountSum", amountSum.setScale(2, RoundingMode.HALF_DOWN).toString());
|
|
|
|
|
map.put("reportList", list);
|
|
|
|
|
//repotData自己加测试数据
|
|
|
|
|
|
|
|
|
@ -698,7 +691,6 @@ if (pMap!=null&&pMap.size()>0){
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//"attachment; filename=" + new String(fileName.getBytes("gbk"), StandardCharsets.ISO_8859_1));
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
log.error("导出pdf失败:{}", e);
|
|
|
|
@ -952,6 +944,7 @@ if (pMap!=null&&pMap.size()>0){
|
|
|
|
|
return purchaseorderPagination.setData(list, list.size());
|
|
|
|
|
}*/
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public List<PurchaseorderitemEntity> getTypeList(PurchaseorderPagination purchaseorderPagination, String dataType) {
|
|
|
|
|
String userId = userProvider.get().getUserId();
|
|
|
|
@ -1094,7 +1087,7 @@ if (pMap!=null&&pMap.size()>0){
|
|
|
|
|
Field declaredField = purchaseorderitemEntity.getClass().getDeclaredField(sidx);
|
|
|
|
|
declaredField.setAccessible(true);
|
|
|
|
|
String value = declaredField.getAnnotation(TableField.class).value();
|
|
|
|
|
purchaseorderQueryWrapper="asc".equals(purchaseorderPagination.getSort().toLowerCase())?purchaseorderQueryWrapper.orderByAsc(value):purchaseorderQueryWrapper.orderByDesc(value);
|
|
|
|
|
purchaseorderQueryWrapper = "asc".equalsIgnoreCase(purchaseorderPagination.getSort()) ? purchaseorderQueryWrapper.orderByAsc(value) : purchaseorderQueryWrapper.orderByDesc(value);
|
|
|
|
|
} catch (NoSuchFieldException e) {
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
}
|
|
|
|
@ -1130,12 +1123,14 @@ if (pMap!=null&&pMap.size()>0){
|
|
|
|
|
entity.setId(id);
|
|
|
|
|
return this.updateById(entity);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void delete(PurchaseorderitemEntity entity) {
|
|
|
|
|
if (entity != null) {
|
|
|
|
|
this.removeById(entity.getId());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//子表方法
|
|
|
|
|
@Override
|
|
|
|
|
public List<Purchaseorder_item0Entity> GetPurchaseorder_item0List(String id) {
|
|
|
|
@ -1190,7 +1185,6 @@ if (pMap!=null&&pMap.size()>0){
|
|
|
|
|
public void getVehicle(List<HashMap<String, Object>> vehicleInfo, String templateFilePath) throws Exception {
|
|
|
|
|
// BufferedInputStream input = null;
|
|
|
|
|
// BufferedOutputStream out = null;
|
|
|
|
|
try{
|
|
|
|
|
if (vehicleInfo != null && vehicleInfo.size() > 0) {
|
|
|
|
|
for (int i = 0; i < vehicleInfo.size(); i++) {
|
|
|
|
|
HashMap<String, Object> map = vehicleInfo.get(i);
|
|
|
|
@ -1229,15 +1223,6 @@ if (pMap!=null&&pMap.size()>0){
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}finally {
|
|
|
|
|
// if (input!=null){
|
|
|
|
|
// input.close();
|
|
|
|
|
// }
|
|
|
|
|
// if (out!=null){
|
|
|
|
|
// out.close();
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -1286,12 +1271,9 @@ if (pMap!=null&&pMap.size()>0){
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@ -1302,6 +1284,9 @@ if (pMap!=null&&pMap.size()>0){
|
|
|
|
|
for (int i = 0; i < purchaseorderList.size(); i++) {
|
|
|
|
|
Map<String, Object> dataRowMap = new HashMap<>();
|
|
|
|
|
PurchaseorderDTO model = purchaseorderList.get(i);
|
|
|
|
|
if (model.getPoundDate()==null){
|
|
|
|
|
|
|
|
|
|
}else {
|
|
|
|
|
dataRowMap.put("poundDate", model.getPoundDate());
|
|
|
|
|
dataRowMap.put("vehicleId", model.getVehicleId());
|
|
|
|
|
dataRowMap.put("materialId", model.getMaterialId());
|
|
|
|
@ -1311,7 +1296,7 @@ if (pMap!=null&&pMap.size()>0){
|
|
|
|
|
dataRowMap.put("buckleWeight", model.getBuckleWeight());
|
|
|
|
|
dataRowMap.put("netWeight", model.getNetWeight());
|
|
|
|
|
dataRowMap.put("settlement", model.getSettlement());
|
|
|
|
|
dataRowMap.put("imgPicturess", model.getPoundPictures());
|
|
|
|
|
dataRowMap.put("poundPictures", model.getPoundPictures());
|
|
|
|
|
dataRowMap.put("advance", model.getAdvance());
|
|
|
|
|
dataRowMap.put("naturalId", model.getNaturalId());
|
|
|
|
|
dataRowMap.put("purchasePrice", model.getPurchasePrice());
|
|
|
|
@ -1323,8 +1308,11 @@ if (pMap!=null&&pMap.size()>0){
|
|
|
|
|
dataRowMap.put("salesId", model.getSalesId());
|
|
|
|
|
dataRowMap.put("purchaseId", model.getPurchaseId());
|
|
|
|
|
dataRowMap.put("customerId", model.getCustomerId());
|
|
|
|
|
dataRowMap.put("carPictures", model.getCarPictures());
|
|
|
|
|
dataRow.add(dataRowMap);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
for (int i = 1; i <= 23; i++) {
|
|
|
|
|
Map<String, Object> columnsMap = new HashMap<>();
|
|
|
|
|
columnsMap.put("AllowDBNull", true);
|
|
|
|
@ -1360,6 +1348,7 @@ if (pMap!=null&&pMap.size()>0){
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 导入
|
|
|
|
|
*
|
|
|
|
|
* @param dataList
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
@ -1373,14 +1362,17 @@ if (pMap!=null&&pMap.size()>0){
|
|
|
|
|
List<PurchaseorderDTO> errList = new ArrayList<>();
|
|
|
|
|
int num1 = dataList.size();
|
|
|
|
|
ArrayList<Integer> ints = new ArrayList<>();
|
|
|
|
|
// 进行编码id的转换
|
|
|
|
|
for (int i = 0; i < num1; i++) {
|
|
|
|
|
PurchaseorderDTO model = dataList.get(i);
|
|
|
|
|
// 收获日期
|
|
|
|
|
if (model.getPoundDate() != null && !model.getPoundDate().isEmpty() && !model.getPoundDate().equals("null")) {
|
|
|
|
|
|
|
|
|
|
// model.setCreatorTime(DateUtil.cstFormat(model.getCreatorTime()));
|
|
|
|
|
Date date = new SimpleDateFormat("yyyy.MM.dd").parse(model.getPoundDate());
|
|
|
|
|
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
|
|
model.setPoundDate(formatter.format(date));
|
|
|
|
|
// 单位
|
|
|
|
|
if (model.getUnit() != null) {
|
|
|
|
|
if (model.getUnit().equals("吨") || model.getUnit().equals("T")) {
|
|
|
|
|
model.setUnit("0");
|
|
|
|
@ -1389,6 +1381,7 @@ if (pMap!=null&&pMap.size()>0){
|
|
|
|
|
model.setUnit("1");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
// 是否垫资
|
|
|
|
|
if (model.getAdvance() != null) {
|
|
|
|
|
if (model.getAdvance().equals("是")) {
|
|
|
|
|
model.setAdvance("1");
|
|
|
|
@ -1397,20 +1390,21 @@ if (pMap!=null&&pMap.size()>0){
|
|
|
|
|
model.setAdvance("0");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
// 送货车号
|
|
|
|
|
if (model.getVehicleId() != null) {
|
|
|
|
|
LambdaQueryWrapper<VehicleEntity> wrapper = new LambdaQueryWrapper<>();
|
|
|
|
|
wrapper.eq(VehicleEntity::getTicketno, model.getVehicleId());
|
|
|
|
|
List<VehicleEntity> vehicleEntityList = vehicleMapper.selectList(wrapper);
|
|
|
|
|
if (vehicleEntityList != null && vehicleEntityList.size() > 0) {
|
|
|
|
|
model.setVehicleId(vehicleEntityList.get(0).getId());
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
} else {
|
|
|
|
|
model.setCauseError("车牌号不存在!请添加车辆信息在尝试添加!");
|
|
|
|
|
errList.add(model);
|
|
|
|
|
ints.add(i);
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
// 货物
|
|
|
|
|
if (model.getMaterialId() != null) {
|
|
|
|
|
LambdaQueryWrapper<MaterialEntity> wrapper = new LambdaQueryWrapper<MaterialEntity>();
|
|
|
|
|
wrapper.eq(MaterialEntity::getItemName, model.getMaterialId());
|
|
|
|
@ -1424,6 +1418,7 @@ if (pMap!=null&&pMap.size()>0){
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
// 业务员2
|
|
|
|
|
if (model.getNaturalId() != null) {
|
|
|
|
|
LambdaQueryWrapper<Jg_naturalEntity> wrapper = new LambdaQueryWrapper<>();
|
|
|
|
|
wrapper.eq(Jg_naturalEntity::getName, model.getNaturalId());
|
|
|
|
@ -1431,12 +1426,13 @@ if (pMap!=null&&pMap.size()>0){
|
|
|
|
|
if (naturalEntityList != null && naturalEntityList.size() > 0) {
|
|
|
|
|
model.setNaturalId(naturalEntityList.get(0).getId());
|
|
|
|
|
} else {
|
|
|
|
|
model.setCauseError("自然人信息不存在!请添加自然人信息后尝试添加!");
|
|
|
|
|
model.setCauseError("业务员2信息不存在!请添加业务员2信息后尝试添加!");
|
|
|
|
|
errList.add(model);
|
|
|
|
|
ints.add(i);
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
// 客户
|
|
|
|
|
if (model.getCustomerId() != null) {
|
|
|
|
|
LambdaQueryWrapper<CustomerEntity> wrapper = new LambdaQueryWrapper<>();
|
|
|
|
|
wrapper.eq(CustomerEntity::getSupplierNm, model.getCustomerId());
|
|
|
|
@ -1450,6 +1446,7 @@ if (pMap!=null&&pMap.size()>0){
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
// 采购合同编码
|
|
|
|
|
if (model.getPurchaseId() != null) {
|
|
|
|
|
LambdaQueryWrapper<PurchaseorderitemEntity> wrapper = new LambdaQueryWrapper<>();
|
|
|
|
|
wrapper.eq(PurchaseorderitemEntity::getDocumentNo, model.getPurchaseId());
|
|
|
|
@ -1463,6 +1460,7 @@ if (pMap!=null&&pMap.size()>0){
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
// 销售合同编码
|
|
|
|
|
if (model.getSalesId() != null) {
|
|
|
|
|
LambdaQueryWrapper<SaleorderitemEntity> wrapper = new LambdaQueryWrapper<>();
|
|
|
|
|
wrapper.eq(SaleorderitemEntity::getDocumentNo, model.getSalesId());
|
|
|
|
@ -1472,10 +1470,12 @@ if (pMap!=null&&pMap.size()>0){
|
|
|
|
|
} else {
|
|
|
|
|
model.setCauseError("销售合同不存在!请添加销售合同后尝试添加!");
|
|
|
|
|
errList.add(model);
|
|
|
|
|
|
|
|
|
|
ints.add(i);
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
// 起始地
|
|
|
|
|
if (model.getOriginPrice() != null) {
|
|
|
|
|
// 区域转换
|
|
|
|
|
LambdaQueryWrapper<ProvinceEntity> wrapper = new LambdaQueryWrapper<>();
|
|
|
|
@ -1525,11 +1525,13 @@ if (pMap!=null&&pMap.size()>0){
|
|
|
|
|
errList.add(model);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
// 错误信息
|
|
|
|
|
ArrayList<PurchaseorderDTO> dtos = new ArrayList<>();
|
|
|
|
|
for (int i = 0; i < ints.size(); i++) {
|
|
|
|
|
Integer integer = ints.get(i);
|
|
|
|
|
dtos.add(dataList.get(integer));
|
|
|
|
|
}
|
|
|
|
|
// 移除错误的信息
|
|
|
|
|
for (int i = 0; i < dtos.size(); i++) {
|
|
|
|
|
PurchaseorderDTO purchaseorderDTO = dtos.get(i);
|
|
|
|
|
dataList.remove(purchaseorderDTO);
|
|
|
|
@ -1565,7 +1567,6 @@ if (dataList.size()>0){
|
|
|
|
|
|
|
|
|
|
//采购
|
|
|
|
|
for (int i = 0; i < dataList.size(); i++) {
|
|
|
|
|
|
|
|
|
|
PurchaseorderDTO model = dataList.get(i);
|
|
|
|
|
Purchaseorder_item0Entity item0 = new Purchaseorder_item0Entity();
|
|
|
|
|
Long aLong2 = new DefaultIdentifierGenerator().nextId(Purchaseorder_item0Entity.class);
|
|
|
|
@ -1585,9 +1586,9 @@ if (dataList.size()>0){
|
|
|
|
|
//rate税率:默认为0 即13个点
|
|
|
|
|
item0.setRate("0");
|
|
|
|
|
//amount金额:price*settlement,保留6位小数
|
|
|
|
|
item0.setAmount(item0.getPrice().multiply(item0.getSettlement()).setScale(6,BigDecimal.ROUND_HALF_UP));
|
|
|
|
|
item0.setAmount(item0.getPrice().multiply(item0.getSettlement()).setScale(6, RoundingMode.HALF_UP));
|
|
|
|
|
//not_amount不含税金额:price*settlement*(1 - 税率) 不含税价格为sum/1.13=price
|
|
|
|
|
item0.setNotAmount(item0.getAmount().divide(new BigDecimal(1+0.13)));
|
|
|
|
|
item0.setNotAmount(item0.getAmount().divide(BigDecimal.valueOf(1 + 0.13)));
|
|
|
|
|
//vehicle_id车辆id:磅单c表车辆id
|
|
|
|
|
item0.setVehicleId(model.getVehicleId());
|
|
|
|
|
//material_id物料id:磅单表物料id
|
|
|
|
@ -1644,7 +1645,6 @@ if (dataList.size()>0){
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
log.error("采购合同不存在!请添加后后重新添加!");
|
|
|
|
|
errList.addAll(dataList);
|
|
|
|
@ -1710,15 +1710,15 @@ if (dataList.size()>0){
|
|
|
|
|
map.put(8, "扣重");
|
|
|
|
|
map.put(9, "净重");
|
|
|
|
|
map.put(10, "结算重量");
|
|
|
|
|
map.put(11, "榜单图片");
|
|
|
|
|
map.put(12, "是否垫资");
|
|
|
|
|
map.put(13, "自然人");
|
|
|
|
|
map.put(14, "采购单价");
|
|
|
|
|
map.put(15, "销售单价");
|
|
|
|
|
map.put(16, "运费");
|
|
|
|
|
map.put(17, "起始地");
|
|
|
|
|
map.put(18, "备注");
|
|
|
|
|
map.put(19, "错误原因");
|
|
|
|
|
map.put(11, "是否垫资");
|
|
|
|
|
map.put(12, "自然人");
|
|
|
|
|
map.put(13, "采购单价");
|
|
|
|
|
map.put(14, "销售单价");
|
|
|
|
|
map.put(15, "运费");
|
|
|
|
|
map.put(16, "起始地");
|
|
|
|
|
map.put(17, "备注");
|
|
|
|
|
map.put(18, "错误原因");
|
|
|
|
|
map.put(19, "车辆图片地址");
|
|
|
|
|
map.put(20, "榜单图片地址");
|
|
|
|
|
map.put(21, "销售合同编码");
|
|
|
|
|
map.put(22, "采购合同编码");
|
|
|
|
|