|
|
@@ -119,7 +119,7 @@ public class SeekPurchaseBomServiceImpl implements SeekPurchaseBomService{
|
|
|
* @return
|
|
|
*/
|
|
|
@Override
|
|
|
- public ResultMap importBom(Workbook workbook, String bomName, User user) {
|
|
|
+ public ResultMap importBom(Workbook workbook, String bomName) {
|
|
|
// 获取第一个工作表
|
|
|
Sheet sheet = workbook.getSheetAt(0);
|
|
|
int colNum = sheet.getRow(0).getPhysicalNumberOfCells();
|
|
|
@@ -133,8 +133,8 @@ public class SeekPurchaseBomServiceImpl implements SeekPurchaseBomService{
|
|
|
// 插入Bom求购中
|
|
|
SeekPurchaseBom seekPurchaseBom = new SeekPurchaseBom();
|
|
|
seekPurchaseBom.setReleaseDate(new Date(System.currentTimeMillis()));
|
|
|
- seekPurchaseBom.setEnuu(user.getEnterprise().getUu());
|
|
|
- seekPurchaseBom.setUu(user.getUserUU());
|
|
|
+// seekPurchaseBom.setEnuu(user.getEnterprise().getUu());
|
|
|
+// seekPurchaseBom.setUu(user.getUserUU());
|
|
|
seekPurchaseBom.setName(bomName);
|
|
|
seekPurchaseBom.setStatus(0);
|
|
|
seekPurchaseBom = seekPurchaseBomDao.save(seekPurchaseBom);
|
|
|
@@ -248,6 +248,11 @@ public class SeekPurchaseBomServiceImpl implements SeekPurchaseBomService{
|
|
|
if (!StringUtils.isEmpty(amountValue)) {
|
|
|
try {
|
|
|
Double amount = Double.valueOf(StringUtilB2C.replaceLineBreak(StringUtilB2C.getStr(amountValue)));
|
|
|
+ if (amount <= 0) {
|
|
|
+ amount = 1d;
|
|
|
+ } else if (amount >= 100000000){
|
|
|
+ amount = 99999999d;
|
|
|
+ }
|
|
|
seekPurchaseByBatch.setAmount(amount);
|
|
|
} catch (NumberFormatException e) {
|
|
|
seekPurchaseByBatch.setAmount(null);
|
|
|
@@ -272,6 +277,11 @@ public class SeekPurchaseBomServiceImpl implements SeekPurchaseBomService{
|
|
|
if (!StringUtils.isEmpty(unitPriceValue)) {
|
|
|
try {
|
|
|
Double unitPrice = Double.valueOf(StringUtilB2C.replaceLineBreak(StringUtilB2C.getStr(unitPriceValue)));
|
|
|
+ if (unitPrice <= 0) {
|
|
|
+ unitPrice = 1d;
|
|
|
+ } else if (unitPrice >= 10000) {
|
|
|
+ unitPrice = 9999d;
|
|
|
+ }
|
|
|
seekPurchaseByBatch.setUnitPrice(unitPrice);
|
|
|
} catch (NumberFormatException e) {
|
|
|
seekPurchaseByBatch.setUnitPrice(null);
|
|
|
@@ -288,6 +298,7 @@ public class SeekPurchaseBomServiceImpl implements SeekPurchaseBomService{
|
|
|
if (!StringUtils.isEmpty(encapsulationValue)) {
|
|
|
try {
|
|
|
String encapsulation = StringUtilB2C.replaceLineBreak(StringUtilB2C.getStr(encapsulationValue));
|
|
|
+ encapsulation = com.uas.platform.b2c.fa.payment.utils.StringUtils.cutOutString(encapsulation, 20);
|
|
|
seekPurchaseByBatch.setEncapsulation(encapsulation);
|
|
|
} catch (Exception e) {
|
|
|
seekPurchaseByBatch.setEncapsulation(null);
|
|
|
@@ -301,6 +312,7 @@ public class SeekPurchaseBomServiceImpl implements SeekPurchaseBomService{
|
|
|
if (!StringUtils.isEmpty(produceDateValue)) {
|
|
|
try {
|
|
|
String produceDate = StringUtilB2C.replaceLineBreak(StringUtilB2C.getStr(produceDateValue));
|
|
|
+ produceDate = com.uas.platform.b2c.fa.payment.utils.StringUtils.cutOutString(produceDate, 20);
|
|
|
seekPurchaseByBatch.setProduceDate(produceDate);
|
|
|
} catch (Exception e) {
|
|
|
seekPurchaseByBatch.setProduceDate(null);
|
|
|
@@ -449,7 +461,7 @@ public class SeekPurchaseBomServiceImpl implements SeekPurchaseBomService{
|
|
|
inquiry.setAmount(deleteBatchList.size());
|
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddsss");
|
|
|
try {
|
|
|
- inquiry.setCode("MALL" + sdf.parse(sdf.format(new Date())));
|
|
|
+ inquiry.setCode("MALL" + sdf.parse(sdf.format(new Date())).getTime());
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
}
|