|
@@ -30,7 +30,7 @@ import com.usoftchina.saas.document.service.*;
|
|
|
import com.usoftchina.saas.exception.BizException;
|
|
import com.usoftchina.saas.exception.BizException;
|
|
|
import com.usoftchina.saas.page.PageRequest;
|
|
import com.usoftchina.saas.page.PageRequest;
|
|
|
import com.usoftchina.saas.utils.CollectionUtils;
|
|
import com.usoftchina.saas.utils.CollectionUtils;
|
|
|
-import com.usoftchina.saas.utils.DateUtils;
|
|
|
|
|
|
|
+import com.usoftchina.saas.utils.ObjectUtils;
|
|
|
import com.usoftchina.saas.utils.RegexpUtils;
|
|
import com.usoftchina.saas.utils.RegexpUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
@@ -142,6 +142,9 @@ public class ProductServiceImpl extends CommonBaseServiceImpl<ProductMapper, Pro
|
|
|
messageLogService.save(docBaseDTO);
|
|
messageLogService.save(docBaseDTO);
|
|
|
}else{
|
|
}else{
|
|
|
String oldCode = getMapper().getCodeById(product.getId());
|
|
String oldCode = getMapper().getCodeById(product.getId());
|
|
|
|
|
+ if (StringUtils.isEmpty(oldCode)){
|
|
|
|
|
+ throw new BizException(BizExceptionCode.ORDER_NOT_EXITTS);
|
|
|
|
|
+ }
|
|
|
if (!product.getPr_code().equals(oldCode)){
|
|
if (!product.getPr_code().equals(oldCode)){
|
|
|
validEnableUpdateCode(product.getId());
|
|
validEnableUpdateCode(product.getId());
|
|
|
}
|
|
}
|
|
@@ -425,7 +428,7 @@ public class ProductServiceImpl extends CommonBaseServiceImpl<ProductMapper, Pro
|
|
|
close(docBaseDTO.getId());
|
|
close(docBaseDTO.getId());
|
|
|
}catch (Exception e){
|
|
}catch (Exception e){
|
|
|
String msg = BizExceptionCode.DEAL_FAILED.getMessage();
|
|
String msg = BizExceptionCode.DEAL_FAILED.getMessage();
|
|
|
- errorMsg.append(String.format(msg, docBaseDTO.getCode(), e.getMessage()));
|
|
|
|
|
|
|
+ errorMsg.append(String.format(msg, docBaseDTO.getCode(), e.getMessage()) + "<br />");
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
return errorMsg.toString();
|
|
return errorMsg.toString();
|
|
@@ -439,7 +442,7 @@ public class ProductServiceImpl extends CommonBaseServiceImpl<ProductMapper, Pro
|
|
|
open(docBaseDTO.getId());
|
|
open(docBaseDTO.getId());
|
|
|
}catch (Exception e){
|
|
}catch (Exception e){
|
|
|
String msg = BizExceptionCode.DEAL_FAILED.getMessage();
|
|
String msg = BizExceptionCode.DEAL_FAILED.getMessage();
|
|
|
- errorMsg.append(String.format(msg, docBaseDTO.getCode(), e.getMessage()));
|
|
|
|
|
|
|
+ errorMsg.append(String.format(msg, docBaseDTO.getCode(), e.getMessage()) + "<br />");
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
return errorMsg.toString();
|
|
return errorMsg.toString();
|
|
@@ -580,6 +583,10 @@ public class ProductServiceImpl extends CommonBaseServiceImpl<ProductMapper, Pro
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
public boolean deleteDetailById(Long id) {
|
|
public boolean deleteDetailById(Long id) {
|
|
|
|
|
+ Product productTemp = getMapper().selectByPrimaryKey(id);
|
|
|
|
|
+ if (ObjectUtils.isEmpty(productTemp)){
|
|
|
|
|
+ throw new BizException(BizExceptionCode.ORDER_NOT_EXITTS);
|
|
|
|
|
+ }
|
|
|
Long prodId = productDetailMapper.selectProdidByPrimaryKey(id);
|
|
Long prodId = productDetailMapper.selectProdidByPrimaryKey(id);
|
|
|
validProductOperation(prodId, BizExceptionCode.BIZ_RELDELETE_DELETEPROD);
|
|
validProductOperation(prodId, BizExceptionCode.BIZ_RELDELETE_DELETEPROD);
|
|
|
String prCode = getMapper().selectByPrimaryKey(prodId).getPr_code();
|
|
String prCode = getMapper().selectByPrimaryKey(prodId).getPr_code();
|