Browse Source

Merge remote-tracking branch 'origin/master'

feature/dangjian
李鹏飞 5 years ago
parent
commit
bf0bd705fb
  1. 22
      esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/service/impl/KpiGridEntityServiceImpl.java

22
esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/service/impl/KpiGridEntityServiceImpl.java

@ -55,6 +55,7 @@ import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.multipart.MultipartFile;
import java.io.File;
import java.text.DecimalFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
@ -142,25 +143,26 @@ public class KpiGridEntityServiceImpl extends BaseServiceImpl<KpiGridEntityDao,
// 设置部门类别
dto.setDeptTypeKey(sysDeptDTO.getTypeKey());
// 计算总分
DecimalFormat df = new DecimalFormat("#.0");
String stationEstablishmentBorder = dto.getStationEstablishmentBorder();
String stationEstablishmentLayout = dto.getStationEstablishmentLayout();
String stationEstablishmentStandard = dto.getStationEstablishmentStandard();
Double stationEstablishmentBorderDouble = Double.parseDouble(stationEstablishmentBorder);
Double stationEstablishmentLayoutDouble = Double.parseDouble(stationEstablishmentLayout);
Double stationEstablishmentStandardDouble = Double.parseDouble(stationEstablishmentStandard);
dto.setStationEstablishment(Double.toString(stationEstablishmentBorderDouble + stationEstablishmentLayoutDouble + stationEstablishmentStandardDouble));
dto.setStationEstablishment(df.format(stationEstablishmentBorderDouble + stationEstablishmentLayoutDouble + stationEstablishmentStandardDouble));
String staffingPlacementInformation = dto.getStaffingPlacementInformation();
String staffingPlacementOfficer = dto.getStaffingPlacementOfficer();
String staffingPlacementPersonnel = dto.getStaffingPlacementPersonnel();
Double staffingPlacementInformationDouble = Double.parseDouble(staffingPlacementInformation);
Double staffingPlacementOfficerDouble = Double.parseDouble(staffingPlacementOfficer);
Double staffingPlacementPersonnelDouble = Double.parseDouble(staffingPlacementPersonnel);
dto.setStaffingPlacement(Double.toString(staffingPlacementInformationDouble + staffingPlacementOfficerDouble + staffingPlacementPersonnelDouble));
dto.setStaffingPlacement(df.format(staffingPlacementInformationDouble + staffingPlacementOfficerDouble + staffingPlacementPersonnelDouble));
String gridOperationOperational = dto.getGridOperationOperational();
String gridOperationWorkplan = dto.getGridOperationWorkplan();
Double gridOperationOperationalDouble = Double.parseDouble(gridOperationOperational);
Double gridOperationWorkplanDouble = Double.parseDouble(gridOperationWorkplan);
dto.setGridOperation(Double.toString(gridOperationOperationalDouble + gridOperationWorkplanDouble));
dto.setGridOperation(df.format(gridOperationOperationalDouble + gridOperationWorkplanDouble));
KpiGridEntityEntity entity = ConvertUtils.sourceToTarget(dto, KpiGridEntityEntity.class);
insert(entity);
@ -169,6 +171,7 @@ public class KpiGridEntityServiceImpl extends BaseServiceImpl<KpiGridEntityDao,
@Override
@Transactional(rollbackFor = Exception.class)
public void update(KpiGridEntityDTO dto) {
DecimalFormat df = new DecimalFormat("#.0");
// 计算总分
String stationEstablishmentBorder = dto.getStationEstablishmentBorder();
String stationEstablishmentLayout = dto.getStationEstablishmentLayout();
@ -176,19 +179,19 @@ public class KpiGridEntityServiceImpl extends BaseServiceImpl<KpiGridEntityDao,
Double stationEstablishmentBorderDouble = Double.parseDouble(stationEstablishmentBorder);
Double stationEstablishmentLayoutDouble = Double.parseDouble(stationEstablishmentLayout);
Double stationEstablishmentStandardDouble = Double.parseDouble(stationEstablishmentStandard);
dto.setStationEstablishment(Double.toString(stationEstablishmentBorderDouble + stationEstablishmentLayoutDouble + stationEstablishmentStandardDouble));
dto.setStationEstablishment(df.format(stationEstablishmentBorderDouble + stationEstablishmentLayoutDouble + stationEstablishmentStandardDouble));
String staffingPlacementInformation = dto.getStaffingPlacementInformation();
String staffingPlacementOfficer = dto.getStaffingPlacementOfficer();
String staffingPlacementPersonnel = dto.getStaffingPlacementPersonnel();
Double staffingPlacementInformationDouble = Double.parseDouble(staffingPlacementInformation);
Double staffingPlacementOfficerDouble = Double.parseDouble(staffingPlacementOfficer);
Double staffingPlacementPersonnelDouble = Double.parseDouble(staffingPlacementPersonnel);
dto.setStaffingPlacement(Double.toString(staffingPlacementInformationDouble + staffingPlacementOfficerDouble + staffingPlacementPersonnelDouble));
dto.setStaffingPlacement(df.format(staffingPlacementInformationDouble + staffingPlacementOfficerDouble + staffingPlacementPersonnelDouble));
String gridOperationOperational = dto.getGridOperationOperational();
String gridOperationWorkplan = dto.getGridOperationWorkplan();
Double gridOperationOperationalDouble = Double.parseDouble(gridOperationOperational);
Double gridOperationWorkplanDouble = Double.parseDouble(gridOperationWorkplan);
dto.setGridOperation(Double.toString(gridOperationOperationalDouble + gridOperationWorkplanDouble));
dto.setGridOperation(df.format(gridOperationOperationalDouble + gridOperationWorkplanDouble));
KpiGridEntityEntity entity = ConvertUtils.sourceToTarget(dto, KpiGridEntityEntity.class);
updateById(entity);
@ -253,6 +256,7 @@ public class KpiGridEntityServiceImpl extends BaseServiceImpl<KpiGridEntityDao,
*/
@Override
public Result importManualScoreExcel(MultipartFile file) {
DecimalFormat df = new DecimalFormat("#.0");
File f = StreamUtils.conversionFile(file);
try {
//判断上传文件类型
@ -324,19 +328,19 @@ public class KpiGridEntityServiceImpl extends BaseServiceImpl<KpiGridEntityDao,
Double stationEstablishmentBorderDouble = Double.parseDouble(stationEstablishmentBorder);
Double stationEstablishmentLayoutDouble = Double.parseDouble(stationEstablishmentLayout);
Double stationEstablishmentStandardDouble = Double.parseDouble(stationEstablishmentStandard);
entity.setStationEstablishment(Double.toString(stationEstablishmentBorderDouble + stationEstablishmentLayoutDouble + stationEstablishmentStandardDouble));
entity.setStationEstablishment(df.format(stationEstablishmentBorderDouble + stationEstablishmentLayoutDouble + stationEstablishmentStandardDouble));
String staffingPlacementInformation = entity.getStaffingPlacementInformation();
String staffingPlacementOfficer = entity.getStaffingPlacementOfficer();
String staffingPlacementPersonnel = entity.getStaffingPlacementPersonnel();
Double staffingPlacementInformationDouble = Double.parseDouble(staffingPlacementInformation);
Double staffingPlacementOfficerDouble = Double.parseDouble(staffingPlacementOfficer);
Double staffingPlacementPersonnelDouble = Double.parseDouble(staffingPlacementPersonnel);
entity.setStaffingPlacement(Double.toString(staffingPlacementInformationDouble + staffingPlacementOfficerDouble + staffingPlacementPersonnelDouble));
entity.setStaffingPlacement(df.format(staffingPlacementInformationDouble + staffingPlacementOfficerDouble + staffingPlacementPersonnelDouble));
String gridOperationOperational = entity.getGridOperationOperational();
String gridOperationWorkplan = entity.getGridOperationWorkplan();
Double gridOperationOperationalDouble = Double.parseDouble(gridOperationOperational);
Double gridOperationWorkplanDouble = Double.parseDouble(gridOperationWorkplan);
entity.setGridOperation(Double.toString(gridOperationOperationalDouble + gridOperationWorkplanDouble));
entity.setGridOperation(df.format(gridOperationOperationalDouble + gridOperationWorkplanDouble));
// 插入数据
insert(entity);
}

Loading…
Cancel
Save