Compare commits
	
		
			No commits in common. "bfabc43b1465fba3885a838749636c7b18356690" and "3adaf6fd603448d1a95940823339277ebc78c7fa" have entirely different histories.
		
	
	
		
			bfabc43b14
			...
			3adaf6fd60
		
	
		| 
						 | 
				
			
			@ -16,7 +16,6 @@ import java.util.ArrayList;
 | 
			
		|||
import java.util.HashMap;
 | 
			
		||||
import java.util.List;
 | 
			
		||||
import java.util.Map;
 | 
			
		||||
import java.util.stream.Collectors;
 | 
			
		||||
 | 
			
		||||
public class MeasureciFormPlugin extends AbstractFormPlugin {
 | 
			
		||||
    @Override
 | 
			
		||||
| 
						 | 
				
			
			@ -29,11 +28,17 @@ public class MeasureciFormPlugin extends AbstractFormPlugin {
 | 
			
		|||
            Object measurecostid = this.getModel().getValue("measurecostid");//成本测算ID
 | 
			
		||||
            DynamicObject measurecost = BusinessDataServiceHelper.loadSingle(measurecostid,"recos_measurecost");
 | 
			
		||||
            DynamicObject project = measurecost.getDynamicObject("project");
 | 
			
		||||
            DynamicObject repmd_projectbill = BusinessDataServiceHelper.loadSingle(project.getPkValue(),"repmd_projectbill");//获取项目
 | 
			
		||||
            DynamicObjectCollection productentry = repmd_projectbill.getDynamicObjectCollection("productentry");//获取对应产品
 | 
			
		||||
            List<DynamicObject> children = productentry .stream().filter(e -> e.getDynamicObject("productentry_producttype").getString("id").equals(producttypeid.toString())).collect(Collectors.toList());
 | 
			
		||||
            DynamicObjectCollection qeug_entryentity = children.get(0).getDynamicObjectCollection("qeug_subentryentity");//子单据体
 | 
			
		||||
            String number = project.getString("number");//项目编码
 | 
			
		||||
            QFilter filter = new QFilter("qeug_cpmc.id", QCP.equals, producttypeid).
 | 
			
		||||
                    and(new QFilter("qeug_xmnumber", QCP.equals, number));
 | 
			
		||||
            DynamicObject queryone = QueryServiceHelper.queryOne("qeug_gcl", "id", filter.toArray());
 | 
			
		||||
            if (queryone==null){
 | 
			
		||||
                this.getView().showSuccessNotification("请维护项目面积数据");
 | 
			
		||||
                return;
 | 
			
		||||
            }
 | 
			
		||||
            Map<String, BigDecimal> result = new HashMap<>();
 | 
			
		||||
            DynamicObject gcl = BusinessDataServiceHelper.loadSingle(queryone.get("id"),"qeug_gcl");
 | 
			
		||||
            DynamicObjectCollection qeug_entryentity = gcl.getDynamicObjectCollection("qeug_entryentity");//面积
 | 
			
		||||
            for (int i = 0; i <qeug_entryentity.size() ; i++) {
 | 
			
		||||
                DynamicObject dynamicObject = qeug_entryentity.get(i);
 | 
			
		||||
                BigDecimal sum = dynamicObject.getBigDecimal("qeug_hjs");
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -12,10 +12,8 @@ import kd.bos.entity.plugin.Plugin;
 | 
			
		|||
import kd.bos.fileservice.FileItem;
 | 
			
		||||
import kd.bos.fileservice.FileService;
 | 
			
		||||
import kd.bos.fileservice.FileServiceFactory;
 | 
			
		||||
import kd.bos.form.ConfirmTypes;
 | 
			
		||||
import kd.bos.form.FormShowParameter;
 | 
			
		||||
import kd.bos.form.IFormView;
 | 
			
		||||
import kd.bos.form.MessageBoxOptions;
 | 
			
		||||
import kd.bos.form.control.AttachmentPanel;
 | 
			
		||||
import kd.bos.form.control.Control;
 | 
			
		||||
import kd.bos.form.control.events.BeforeItemClickEvent;
 | 
			
		||||
| 
						 | 
				
			
			@ -189,19 +187,6 @@ public class RecosMeasurecosFormPlugin extends AbstractFormPlugin implements Upl
 | 
			
		|||
 | 
			
		||||
            // 单据列表数据风格样式,设置字体为黑体,字号15
 | 
			
		||||
            XSSFCellStyle billStyle = workbook.createCellStyle();
 | 
			
		||||
 | 
			
		||||
            // 设置边框
 | 
			
		||||
            billStyle.setBorderBottom(BorderStyle.THIN);
 | 
			
		||||
            billStyle.setBorderTop(BorderStyle.THIN);
 | 
			
		||||
            billStyle.setBorderLeft(BorderStyle.THIN);
 | 
			
		||||
            billStyle.setBorderRight(BorderStyle.THIN);
 | 
			
		||||
 | 
			
		||||
            // 设置边框颜色
 | 
			
		||||
            billStyle.setBottomBorderColor(IndexedColors.BLACK.getIndex());
 | 
			
		||||
            billStyle.setTopBorderColor(IndexedColors.BLACK.getIndex());
 | 
			
		||||
            billStyle.setLeftBorderColor(IndexedColors.BLACK.getIndex());
 | 
			
		||||
            billStyle.setRightBorderColor(IndexedColors.BLACK.getIndex());
 | 
			
		||||
 | 
			
		||||
            // 设置水平居中
 | 
			
		||||
            billStyle.setAlignment(HorizontalAlignment.CENTER);
 | 
			
		||||
            // 设置垂直居中
 | 
			
		||||
| 
						 | 
				
			
			@ -218,17 +203,6 @@ public class RecosMeasurecosFormPlugin extends AbstractFormPlugin implements Upl
 | 
			
		|||
                for (int u=0;u<excel.get(i).size();u++){
 | 
			
		||||
                    XSSFCell ncell = nrow.createCell(u);
 | 
			
		||||
                    ncell.setCellStyle(billStyle);
 | 
			
		||||
                    if (i==0){
 | 
			
		||||
                        // 创建单元格样式
 | 
			
		||||
                        CellStyle style = workbook.createCellStyle();
 | 
			
		||||
                        style.setAlignment(HorizontalAlignment.CENTER);
 | 
			
		||||
                        // 设置垂直居中
 | 
			
		||||
                        style.setVerticalAlignment(VerticalAlignment.CENTER);
 | 
			
		||||
                        // 设置背景颜色为淡灰色
 | 
			
		||||
                        style.setFillForegroundColor(IndexedColors.GREY_25_PERCENT.getIndex());
 | 
			
		||||
                        style.setFillPattern(FillPatternType.SOLID_FOREGROUND);
 | 
			
		||||
                        ncell.setCellStyle(style);
 | 
			
		||||
                    }
 | 
			
		||||
                    Object s = excel.get(i).get(u);
 | 
			
		||||
                    if (s instanceof BigDecimal) {
 | 
			
		||||
                        BigDecimal b=(BigDecimal)s;
 | 
			
		||||
| 
						 | 
				
			
			@ -341,25 +315,19 @@ public class RecosMeasurecosFormPlugin extends AbstractFormPlugin implements Upl
 | 
			
		|||
                                    break;
 | 
			
		||||
                                }
 | 
			
		||||
                            }
 | 
			
		||||
                            for (int j = rowNum; j <= rowCountsheet - 1; j++){//序号行至最后一行
 | 
			
		||||
                            for (int j = rowNum; j <= rowCountsheet - 2; j++){//序号行至最后一行总计前一行
 | 
			
		||||
                                Row row = sheet.getRow(j);
 | 
			
		||||
                                Calculation calculation = null;
 | 
			
		||||
                                try {
 | 
			
		||||
                                    calculation = new Calculation(
 | 
			
		||||
                                            String.valueOf(getcellvallue(row.getCell(6))),//科目编码
 | 
			
		||||
                                            String.valueOf(getcellvallue(row.getCell(7))),//科目名称
 | 
			
		||||
                                            String.valueOf(getcellvallue(row.getCell(10))),//单位
 | 
			
		||||
                                            (double)getcellvallue(row.getCell(12)),// 调整系数
 | 
			
		||||
                                            (double)getcellvallue(row.getCell(14)),//合价(含税)
 | 
			
		||||
                                            (double)getcellvallue(row.getCell(13)),//单价
 | 
			
		||||
                                            (double)getcellvallue(row.getCell(11)),//工程量
 | 
			
		||||
                                            String.valueOf(getcellvallue(row.getCell(9))),//估算口径
 | 
			
		||||
                                            String.valueOf(getcellvallue(row.getCell(15)))//备注
 | 
			
		||||
                                    );
 | 
			
		||||
                                } catch (Exception e) {
 | 
			
		||||
                                    this.getView().showConfirm("导入功能失败", e.getMessage()+"原因:"+sheetName+"第"+(j+1)+"行获取数据格式有误,请检查", MessageBoxOptions.OK, ConfirmTypes.Default, null);
 | 
			
		||||
                                    return;
 | 
			
		||||
                                }
 | 
			
		||||
                                Calculation calculation = new Calculation(
 | 
			
		||||
                                        row.getCell(6).getStringCellValue(),//科目编码
 | 
			
		||||
                                        row.getCell(7).getStringCellValue(),//科目名称
 | 
			
		||||
                                        row.getCell(10).getStringCellValue(),//单位
 | 
			
		||||
                                        row.getCell(12).getNumericCellValue(),// 调整系数
 | 
			
		||||
                                        row.getCell(14).getNumericCellValue(),//合价(含税)
 | 
			
		||||
                                        row.getCell(13).getNumericCellValue(),//单价
 | 
			
		||||
                                        row.getCell(11).getNumericCellValue(),//工程量
 | 
			
		||||
                                        row.getCell(9).getStringCellValue(),//估算口径
 | 
			
		||||
                                        String.valueOf(getcellvallue(row.getCell(15)))//备注
 | 
			
		||||
                                );
 | 
			
		||||
                                arrayList.add(calculation);
 | 
			
		||||
                            }
 | 
			
		||||
                            String res = updateRecosMeasurecos(arrayList, sheetName,result);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue