|
@@ -18,9 +18,9 @@ import com.usoftchina.saas.purchase.po.*;
|
|
|
import com.usoftchina.saas.purchase.service.PurchaseService;
|
|
import com.usoftchina.saas.purchase.service.PurchaseService;
|
|
|
import com.usoftchina.saas.utils.BeanMapper;
|
|
import com.usoftchina.saas.utils.BeanMapper;
|
|
|
|
|
|
|
|
-import com.usoftchina.saas.utils.StringUtils;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
+import org.springframework.util.StringUtils;
|
|
|
|
|
|
|
|
import java.util.ArrayList;
|
|
import java.util.ArrayList;
|
|
|
import java.util.Date;
|
|
import java.util.Date;
|
|
@@ -97,13 +97,13 @@ public class PurchaseServiceImpl extends CommonBaseServiceImpl<PurchaseMapper, P
|
|
|
Purchase purchase = BeanMapper.map(main, Purchase.class);
|
|
Purchase purchase = BeanMapper.map(main, Purchase.class);
|
|
|
|
|
|
|
|
//编号获取
|
|
//编号获取
|
|
|
- if (!StringUtils.hasText(pu_code)) {
|
|
|
|
|
|
|
+ if (StringUtils.isEmpty(pu_code)) {
|
|
|
pu_code = "PU" + Math.random() * 1000;
|
|
pu_code = "PU" + Math.random() * 1000;
|
|
|
purchase.setPu_code(pu_code);
|
|
purchase.setPu_code(pu_code);
|
|
|
}
|
|
}
|
|
|
saveDTO.setCode(pu_code);
|
|
saveDTO.setCode(pu_code);
|
|
|
//判断更新与保存动作
|
|
//判断更新与保存动作
|
|
|
- if (StringUtils.hasText(pu_id)) {
|
|
|
|
|
|
|
+ if (!StringUtils.isEmpty(pu_id)) {
|
|
|
//更新主表
|
|
//更新主表
|
|
|
purchaseMapper.updateByPrimaryKey(purchase);
|
|
purchaseMapper.updateByPrimaryKey(purchase);
|
|
|
//添加从表传输对象
|
|
//添加从表传输对象
|
|
@@ -111,7 +111,7 @@ public class PurchaseServiceImpl extends CommonBaseServiceImpl<PurchaseMapper, P
|
|
|
PurchaseItem detail = BeanMapper.map(item, PurchaseItem.class);
|
|
PurchaseItem detail = BeanMapper.map(item, PurchaseItem.class);
|
|
|
detail.setPd_puid(pu_id);
|
|
detail.setPd_puid(pu_id);
|
|
|
detail.setPd_code(pu_code);
|
|
detail.setPd_code(pu_code);
|
|
|
- if (StringUtils.hasText(detail.getId())) {
|
|
|
|
|
|
|
+ if (!StringUtils.isEmpty(detail.getId())) {
|
|
|
updateDetails.add(detail);
|
|
updateDetails.add(detail);
|
|
|
} else {
|
|
} else {
|
|
|
insertDetails.add(detail);
|
|
insertDetails.add(detail);
|
|
@@ -162,7 +162,7 @@ public class PurchaseServiceImpl extends CommonBaseServiceImpl<PurchaseMapper, P
|
|
|
Long id = null;
|
|
Long id = null;
|
|
|
if (null != formData) {
|
|
if (null != formData) {
|
|
|
id = formData.getMain().getId();
|
|
id = formData.getMain().getId();
|
|
|
- if (!StringUtils.hasText(id)) {
|
|
|
|
|
|
|
+ if (StringUtils.isEmpty(id)) {
|
|
|
DocSavedDTO saveDTO = saveFormData(formData);
|
|
DocSavedDTO saveDTO = saveFormData(formData);
|
|
|
id = saveDTO.getId();
|
|
id = saveDTO.getId();
|
|
|
}
|
|
}
|
|
@@ -177,7 +177,7 @@ public class PurchaseServiceImpl extends CommonBaseServiceImpl<PurchaseMapper, P
|
|
|
baseDTOs.getBaseDTOs().size() == 0)
|
|
baseDTOs.getBaseDTOs().size() == 0)
|
|
|
return;
|
|
return;
|
|
|
String validate = purchaseMapper.validateAudit(baseDTOs.getBaseDTOs());
|
|
String validate = purchaseMapper.validateAudit(baseDTOs.getBaseDTOs());
|
|
|
- if (StringUtils.hasText(validate)) {
|
|
|
|
|
|
|
+ if (!StringUtils.isEmpty(validate)) {
|
|
|
throw new BizException(500, "存在已审核单据,单据编号:" + validate);
|
|
throw new BizException(500, "存在已审核单据,单据编号:" + validate);
|
|
|
}
|
|
}
|
|
|
for (DocBaseDTO base : baseDTOs.getBaseDTOs()) {
|
|
for (DocBaseDTO base : baseDTOs.getBaseDTOs()) {
|
|
@@ -219,7 +219,7 @@ public class PurchaseServiceImpl extends CommonBaseServiceImpl<PurchaseMapper, P
|
|
|
|
|
|
|
|
private List<PurchaseList> getListByMode(PurchaseReqDTO req) {
|
|
private List<PurchaseList> getListByMode(PurchaseReqDTO req) {
|
|
|
List<PurchaseList> list = null;
|
|
List<PurchaseList> list = null;
|
|
|
- if (null == req || !StringUtils.hasText(req.getMode()) || "Main".equals(req.getMode())) {
|
|
|
|
|
|
|
+ if (null == req || StringUtils.isEmpty(req.getMode()) || "Main".equals(req.getMode())) {
|
|
|
list = purchaseListMapper.selectPurchaseBycondition(req);
|
|
list = purchaseListMapper.selectPurchaseBycondition(req);
|
|
|
} else {
|
|
} else {
|
|
|
list = purchaseListMapper.selectPurchaseListByCondition(req);
|
|
list = purchaseListMapper.selectPurchaseListByCondition(req);
|