|
|
|
@ -112,7 +112,7 @@ public class MesUnitPriceServiceImpl implements IMesUnitPriceService {
|
|
|
|
|
@DS("#header.poolName")
|
|
|
|
|
public String importMesUnitPrice(List<MesUnitPrice> UnitPriceList, Boolean updateSupport, String operName) {
|
|
|
|
|
if (StringUtils.isNull(UnitPriceList) || UnitPriceList.size() == 0) {
|
|
|
|
|
throw new ServiceException("导入用户数据不能为空!");
|
|
|
|
|
throw new ServiceException("导入计件薪酬基础数据不能为空!");
|
|
|
|
|
}
|
|
|
|
|
int successNum = 0;
|
|
|
|
|
int failureNum = 0;
|
|
|
|
@ -146,34 +146,5 @@ public class MesUnitPriceServiceImpl implements IMesUnitPriceService {
|
|
|
|
|
successMsg.insert(0, "恭喜您,数据已全部导入成功!共 " + successNum + " 条,数据如下:");
|
|
|
|
|
}
|
|
|
|
|
return successMsg.toString();
|
|
|
|
|
// if (StringUtils.isNull(UnitPriceList) || UnitPriceList.size() == 0) {
|
|
|
|
|
// throw new ServiceException("导入数据不能为空!");
|
|
|
|
|
// }
|
|
|
|
|
// int successNum = 0;
|
|
|
|
|
// int failureNum = 0;
|
|
|
|
|
// StringBuilder successMsg = new StringBuilder();
|
|
|
|
|
// StringBuilder failureMsg = new StringBuilder();
|
|
|
|
|
// for (MesUnitPrice mesUnitPrice : UnitPriceList) {
|
|
|
|
|
// try {
|
|
|
|
|
// // 验证是否存在这个产线产品
|
|
|
|
|
// mesUnitPrice.setPicId(IdUtils.simpleUUID());
|
|
|
|
|
// mesUnitPriceMapper.insertMesUnitPrice(mesUnitPrice);
|
|
|
|
|
// successNum++;
|
|
|
|
|
// successMsg.append("导入成功");
|
|
|
|
|
//
|
|
|
|
|
// } catch (Exception e) {
|
|
|
|
|
// failureNum++;
|
|
|
|
|
// String msg = "导入失败:";
|
|
|
|
|
// failureMsg.append(msg + e.getMessage());
|
|
|
|
|
// log.error(msg, e);
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// if (failureNum > 0) {
|
|
|
|
|
// failureMsg.insert(0, "很抱歉,导入失败!共 " + failureNum + " 条数据格式不正确,错误如下:");
|
|
|
|
|
// throw new ServiceException(failureMsg.toString());
|
|
|
|
|
// } else {
|
|
|
|
|
// successMsg.insert(0, "恭喜您,数据已全部导入成功!共 " + successNum + " 条,数据如下:");
|
|
|
|
|
// }
|
|
|
|
|
// return successMsg.toString();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|