|
@@ -2,12 +2,14 @@ package com.caimei.modules.user.service;
|
|
|
|
|
|
import java.util.Date;
|
|
|
import java.util.List;
|
|
|
+import java.util.Objects;
|
|
|
|
|
|
import com.caimei.dfs.image.beens.ImageUploadInfo;
|
|
|
import com.caimei.modules.cibe.entity.ShopCert;
|
|
|
import com.caimei.modules.common.utils.UploadUtils;
|
|
|
import com.caimei.modules.sys.utils.UploadImageUtils;
|
|
|
import com.caimei.modules.user.dao.CmUserDao;
|
|
|
+import com.caimei.modules.user.entity.SplitCode;
|
|
|
import com.thinkgem.jeesite.common.config.Global;
|
|
|
import com.thinkgem.jeesite.common.utils.Encodes;
|
|
|
import com.thinkgem.jeesite.common.utils.StringUtils;
|
|
@@ -24,6 +26,7 @@ import com.caimei.modules.user.dao.NewCmShopDao;
|
|
|
|
|
|
/**
|
|
|
* 用户模块重构-供应商信息Service
|
|
|
+ *
|
|
|
* @author zcp
|
|
|
* @version 2018-05-21
|
|
|
*/
|
|
@@ -31,239 +34,255 @@ import com.caimei.modules.user.dao.NewCmShopDao;
|
|
|
@Transactional(readOnly = true)
|
|
|
public class NewCmShopService extends CrudService<NewCmShopDao, NewCmShop> {
|
|
|
|
|
|
- @Autowired
|
|
|
- private NewCmShopDao newCmShopDao;
|
|
|
- @Autowired
|
|
|
- private CmUserDao cmUserDao;
|
|
|
+ @Autowired
|
|
|
+ private NewCmShopDao newCmShopDao;
|
|
|
+ @Autowired
|
|
|
+ private CmUserDao cmUserDao;
|
|
|
|
|
|
- public NewCmShop get(String id) {
|
|
|
- return super.get(id);
|
|
|
- }
|
|
|
+ public NewCmShop get(String id) {
|
|
|
+ return super.get(id);
|
|
|
+ }
|
|
|
|
|
|
- public List<NewCmShop> findList(NewCmShop newCmShop) {
|
|
|
- return super.findList(newCmShop);
|
|
|
- }
|
|
|
+ public List<NewCmShop> findList(NewCmShop newCmShop) {
|
|
|
+ return super.findList(newCmShop);
|
|
|
+ }
|
|
|
|
|
|
- public Page<NewCmShop> findPage(Page<NewCmShop> page, NewCmShop newCmShop) {
|
|
|
- return super.findPage(page, newCmShop);
|
|
|
- }
|
|
|
+ public Page<NewCmShop> findPage(Page<NewCmShop> page, NewCmShop newCmShop) {
|
|
|
+ return super.findPage(page, newCmShop);
|
|
|
+ }
|
|
|
|
|
|
-@Transactional(readOnly = false)
|
|
|
- public void updateUserAudit(String auditStatus, String auditNote, String auditTime, String manufacturerStatus, Integer userId,String validFlag){
|
|
|
- cmUserDao.updateUserAudit(auditStatus,auditNote,auditTime,manufacturerStatus,userId,validFlag);
|
|
|
- }
|
|
|
+ @Transactional(readOnly = false)
|
|
|
+ public void updateUserAudit(String auditStatus, String auditNote, String auditTime, String manufacturerStatus, Integer userId, String validFlag) {
|
|
|
+ cmUserDao.updateUserAudit(auditStatus, auditNote, auditTime, manufacturerStatus, userId, validFlag);
|
|
|
+ }
|
|
|
|
|
|
-@Transactional(readOnly = false)
|
|
|
- public void updateShopStatus(String status,Integer userID){
|
|
|
- cmUserDao.updateShopStatus(status,userID);
|
|
|
- }
|
|
|
+ @Transactional(readOnly = false)
|
|
|
+ public void updateShopStatus(String status, Integer userID) {
|
|
|
+ cmUserDao.updateShopStatus(status, userID);
|
|
|
+ }
|
|
|
|
|
|
-@Transactional(readOnly = false)
|
|
|
- public void updateShopAudit(String auditStatus, String auditNote, String auditTime,String name, String manufacturerStatus, Integer shopId){
|
|
|
- cmUserDao.updateShopAudit(auditStatus,auditNote,auditTime,name,manufacturerStatus,shopId);
|
|
|
- }
|
|
|
+ @Transactional(readOnly = false)
|
|
|
+ public void updateShopAudit(String auditStatus, String auditNote, String auditTime, String name, String manufacturerStatus, Integer shopId) {
|
|
|
+ cmUserDao.updateShopAudit(auditStatus, auditNote, auditTime, name, manufacturerStatus, shopId);
|
|
|
+ }
|
|
|
|
|
|
- public NewCmShop getShopcert(NewCmShop newCmShop){
|
|
|
- Integer shopId = newCmShop.getShopID();
|
|
|
- // 荣誉证书
|
|
|
- List<ShopCert> shopcert = newCmShopDao.getShopcert(shopId,"1");
|
|
|
- if(CollectionUtils.isNotEmpty(shopcert) && shopcert.size() > 0){
|
|
|
- if(shopcert.size() == 1){
|
|
|
- newCmShop.setHonorCertificate1(shopcert.get(0).getImage());
|
|
|
- }
|
|
|
- if(shopcert.size() == 2){
|
|
|
- newCmShop.setHonorCertificate1(shopcert.get(0).getImage());
|
|
|
- newCmShop.setHonorCertificate2(shopcert.get(1).getImage());
|
|
|
- }
|
|
|
- if(shopcert.size() == 3){
|
|
|
- newCmShop.setHonorCertificate1(shopcert.get(0).getImage());
|
|
|
- newCmShop.setHonorCertificate2(shopcert.get(1).getImage());
|
|
|
- newCmShop.setHonorCertificate3(shopcert.get(2).getImage());
|
|
|
- }
|
|
|
- if(shopcert.size() == 4){
|
|
|
- newCmShop.setHonorCertificate1(shopcert.get(0).getImage());
|
|
|
- newCmShop.setHonorCertificate2(shopcert.get(1).getImage());
|
|
|
- newCmShop.setHonorCertificate3(shopcert.get(2).getImage());
|
|
|
- newCmShop.setHonorCertificate4(shopcert.get(3).getImage());
|
|
|
- }
|
|
|
- if(shopcert.size() >= 5){
|
|
|
- newCmShop.setHonorCertificate1(shopcert.get(0).getImage());
|
|
|
- newCmShop.setHonorCertificate2(shopcert.get(1).getImage());
|
|
|
- newCmShop.setHonorCertificate3(shopcert.get(2).getImage());
|
|
|
- newCmShop.setHonorCertificate4(shopcert.get(3).getImage());
|
|
|
- newCmShop.setHonorCertificate5(shopcert.get(4).getImage());
|
|
|
- }
|
|
|
- }
|
|
|
+ public NewCmShop getShopcert(NewCmShop newCmShop) {
|
|
|
+ Integer shopId = newCmShop.getShopID();
|
|
|
+ // 荣誉证书
|
|
|
+ List<ShopCert> shopcert = newCmShopDao.getShopcert(shopId, "1");
|
|
|
+ if (CollectionUtils.isNotEmpty(shopcert) && shopcert.size() > 0) {
|
|
|
+ if (shopcert.size() == 1) {
|
|
|
+ newCmShop.setHonorCertificate1(shopcert.get(0).getImage());
|
|
|
+ }
|
|
|
+ if (shopcert.size() == 2) {
|
|
|
+ newCmShop.setHonorCertificate1(shopcert.get(0).getImage());
|
|
|
+ newCmShop.setHonorCertificate2(shopcert.get(1).getImage());
|
|
|
+ }
|
|
|
+ if (shopcert.size() == 3) {
|
|
|
+ newCmShop.setHonorCertificate1(shopcert.get(0).getImage());
|
|
|
+ newCmShop.setHonorCertificate2(shopcert.get(1).getImage());
|
|
|
+ newCmShop.setHonorCertificate3(shopcert.get(2).getImage());
|
|
|
+ }
|
|
|
+ if (shopcert.size() == 4) {
|
|
|
+ newCmShop.setHonorCertificate1(shopcert.get(0).getImage());
|
|
|
+ newCmShop.setHonorCertificate2(shopcert.get(1).getImage());
|
|
|
+ newCmShop.setHonorCertificate3(shopcert.get(2).getImage());
|
|
|
+ newCmShop.setHonorCertificate4(shopcert.get(3).getImage());
|
|
|
+ }
|
|
|
+ if (shopcert.size() >= 5) {
|
|
|
+ newCmShop.setHonorCertificate1(shopcert.get(0).getImage());
|
|
|
+ newCmShop.setHonorCertificate2(shopcert.get(1).getImage());
|
|
|
+ newCmShop.setHonorCertificate3(shopcert.get(2).getImage());
|
|
|
+ newCmShop.setHonorCertificate4(shopcert.get(3).getImage());
|
|
|
+ newCmShop.setHonorCertificate5(shopcert.get(4).getImage());
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
- List<ShopCert> shopcert2 = newCmShopDao.getShopcert(shopId,"2");
|
|
|
- if(CollectionUtils.isNotEmpty(shopcert2) && shopcert2.size() > 0){
|
|
|
- newCmShop.setProductionLicense(shopcert2.get(0).getImage());
|
|
|
- }
|
|
|
+ List<ShopCert> shopcert2 = newCmShopDao.getShopcert(shopId, "2");
|
|
|
+ if (CollectionUtils.isNotEmpty(shopcert2) && shopcert2.size() > 0) {
|
|
|
+ newCmShop.setProductionLicense(shopcert2.get(0).getImage());
|
|
|
+ }
|
|
|
|
|
|
- List<ShopCert> shopcert3 = newCmShopDao.getShopcert(shopId,"3");
|
|
|
- if(CollectionUtils.isNotEmpty(shopcert3) && shopcert3.size() > 0){
|
|
|
- newCmShop.setProductCertificate(shopcert3.get(0).getImage());
|
|
|
- }
|
|
|
+ List<ShopCert> shopcert3 = newCmShopDao.getShopcert(shopId, "3");
|
|
|
+ if (CollectionUtils.isNotEmpty(shopcert3) && shopcert3.size() > 0) {
|
|
|
+ newCmShop.setProductCertificate(shopcert3.get(0).getImage());
|
|
|
+ }
|
|
|
|
|
|
- List<ShopCert> shopcert5 = newCmShopDao.getShopcert(shopId,"5");
|
|
|
- if(CollectionUtils.isNotEmpty(shopcert5) && shopcert5.size() > 0){
|
|
|
- newCmShop.setSanitationPermit(shopcert5.get(0).getImage());
|
|
|
- }
|
|
|
+ List<ShopCert> shopcert5 = newCmShopDao.getShopcert(shopId, "5");
|
|
|
+ if (CollectionUtils.isNotEmpty(shopcert5) && shopcert5.size() > 0) {
|
|
|
+ newCmShop.setSanitationPermit(shopcert5.get(0).getImage());
|
|
|
+ }
|
|
|
|
|
|
- List<ShopCert> shopcert6 = newCmShopDao.getShopcert(shopId,"6");
|
|
|
- if(CollectionUtils.isNotEmpty(shopcert6) && shopcert6.size() > 0){
|
|
|
- newCmShop.setTaxPermit(shopcert6.get(0).getImage());
|
|
|
- }
|
|
|
- return newCmShop;
|
|
|
- }
|
|
|
+ List<ShopCert> shopcert6 = newCmShopDao.getShopcert(shopId, "6");
|
|
|
+ if (CollectionUtils.isNotEmpty(shopcert6) && shopcert6.size() > 0) {
|
|
|
+ newCmShop.setTaxPermit(shopcert6.get(0).getImage());
|
|
|
+ }
|
|
|
+ //分帐号查询
|
|
|
+ List<SplitCode> splitCodes = newCmShopDao.findSplitCode(newCmShop.getShopID());
|
|
|
+ if (null != splitCodes && splitCodes.size() > 0) {
|
|
|
+ newCmShop.setSplitCodes(splitCodes);
|
|
|
+ }
|
|
|
+ return newCmShop;
|
|
|
+ }
|
|
|
|
|
|
- @Transactional(readOnly = false)
|
|
|
- public void update(NewCmShop newCmShop){
|
|
|
- // 供应商logo
|
|
|
- String logo = newCmShop.getLogo();
|
|
|
- if(StringUtils.isNotEmpty(logo)){
|
|
|
- logo = getImageUrl(logo);
|
|
|
- newCmShop.setLogo(logo);
|
|
|
- }
|
|
|
- // 营业执照
|
|
|
+ @Transactional(readOnly = false)
|
|
|
+ public void update(NewCmShop newCmShop) {
|
|
|
+ // 供应商logo
|
|
|
+ String logo = newCmShop.getLogo();
|
|
|
+ if (StringUtils.isNotEmpty(logo)) {
|
|
|
+ logo = getImageUrl(logo);
|
|
|
+ newCmShop.setLogo(logo);
|
|
|
+ }
|
|
|
+ // 营业执照
|
|
|
String businessLicenseImage = newCmShop.getBusinessLicenseImage();
|
|
|
if (StringUtils.isNotEmpty(businessLicenseImage)) {
|
|
|
- businessLicenseImage = getImageUrl(businessLicenseImage);
|
|
|
+ businessLicenseImage = getImageUrl(businessLicenseImage);
|
|
|
newCmShop.setBusinessLicenseImage(businessLicenseImage);
|
|
|
}
|
|
|
// 供应商基础信息保存
|
|
|
- newCmShopDao.update(newCmShop);
|
|
|
- //清除所有供应商证书再保存
|
|
|
- newCmShopDao.deleteCert(newCmShop.getShopID());
|
|
|
- // 1、荣誉证书
|
|
|
- String honorCertificate1 = newCmShop.getHonorCertificate1();
|
|
|
- String honorCertificate2 = newCmShop.getHonorCertificate2();
|
|
|
- String honorCertificate3 = newCmShop.getHonorCertificate3();
|
|
|
- String honorCertificate4 = newCmShop.getHonorCertificate4();
|
|
|
- String honorCertificate5 = newCmShop.getHonorCertificate5();
|
|
|
- // 2、生产许可
|
|
|
- String productionLicense = newCmShop.getProductionLicense();
|
|
|
- // 3、产品证书
|
|
|
- String productCertificate = newCmShop.getProductCertificate();
|
|
|
- ///5、卫生许可
|
|
|
- String sanitationPermit = newCmShop.getSanitationPermit();
|
|
|
- // 6、税务许可
|
|
|
- String taxPermit = newCmShop.getTaxPermit();
|
|
|
- if(StringUtils.isNotEmpty(honorCertificate1)){
|
|
|
- honorCertificate1 = getImageUrl(honorCertificate1);
|
|
|
- ShopCert shopCert = new ShopCert();
|
|
|
+ newCmShopDao.update(newCmShop);
|
|
|
+ //清除所有供应商证书再保存
|
|
|
+ newCmShopDao.deleteCert(newCmShop.getShopID());
|
|
|
+ // 1、荣誉证书
|
|
|
+ String honorCertificate1 = newCmShop.getHonorCertificate1();
|
|
|
+ String honorCertificate2 = newCmShop.getHonorCertificate2();
|
|
|
+ String honorCertificate3 = newCmShop.getHonorCertificate3();
|
|
|
+ String honorCertificate4 = newCmShop.getHonorCertificate4();
|
|
|
+ String honorCertificate5 = newCmShop.getHonorCertificate5();
|
|
|
+ // 2、生产许可
|
|
|
+ String productionLicense = newCmShop.getProductionLicense();
|
|
|
+ // 3、产品证书
|
|
|
+ String productCertificate = newCmShop.getProductCertificate();
|
|
|
+ ///5、卫生许可
|
|
|
+ String sanitationPermit = newCmShop.getSanitationPermit();
|
|
|
+ // 6、税务许可
|
|
|
+ String taxPermit = newCmShop.getTaxPermit();
|
|
|
+ if (StringUtils.isNotEmpty(honorCertificate1)) {
|
|
|
+ honorCertificate1 = getImageUrl(honorCertificate1);
|
|
|
+ ShopCert shopCert = new ShopCert();
|
|
|
shopCert.setShopID(newCmShop.getShopID());
|
|
|
shopCert.setShopCertTypeID("1");//
|
|
|
shopCert.setName("荣誉证书");
|
|
|
shopCert.setImage(honorCertificate1);
|
|
|
- newCmShopDao.saveShopcert(shopCert);
|
|
|
- }
|
|
|
- if(StringUtils.isNotEmpty(honorCertificate2)){
|
|
|
- honorCertificate2 = getImageUrl(honorCertificate2);
|
|
|
- ShopCert shopCert = new ShopCert();
|
|
|
+ newCmShopDao.saveShopcert(shopCert);
|
|
|
+ }
|
|
|
+ if (StringUtils.isNotEmpty(honorCertificate2)) {
|
|
|
+ honorCertificate2 = getImageUrl(honorCertificate2);
|
|
|
+ ShopCert shopCert = new ShopCert();
|
|
|
shopCert.setShopID(newCmShop.getShopID());
|
|
|
shopCert.setShopCertTypeID("1");//
|
|
|
shopCert.setName("荣誉证书");
|
|
|
shopCert.setImage(honorCertificate2);
|
|
|
- newCmShopDao.saveShopcert(shopCert);
|
|
|
- }
|
|
|
- if(StringUtils.isNotEmpty(honorCertificate3)){
|
|
|
- honorCertificate3 = getImageUrl(honorCertificate3);
|
|
|
- ShopCert shopCert = new ShopCert();
|
|
|
+ newCmShopDao.saveShopcert(shopCert);
|
|
|
+ }
|
|
|
+ if (StringUtils.isNotEmpty(honorCertificate3)) {
|
|
|
+ honorCertificate3 = getImageUrl(honorCertificate3);
|
|
|
+ ShopCert shopCert = new ShopCert();
|
|
|
shopCert.setShopID(newCmShop.getShopID());
|
|
|
shopCert.setShopCertTypeID("1");//
|
|
|
shopCert.setName("荣誉证书");
|
|
|
shopCert.setImage(honorCertificate3);
|
|
|
- newCmShopDao.saveShopcert(shopCert);
|
|
|
- }
|
|
|
- if(StringUtils.isNotEmpty(honorCertificate4)){
|
|
|
- honorCertificate4 = getImageUrl(honorCertificate4);
|
|
|
- ShopCert shopCert = new ShopCert();
|
|
|
+ newCmShopDao.saveShopcert(shopCert);
|
|
|
+ }
|
|
|
+ if (StringUtils.isNotEmpty(honorCertificate4)) {
|
|
|
+ honorCertificate4 = getImageUrl(honorCertificate4);
|
|
|
+ ShopCert shopCert = new ShopCert();
|
|
|
shopCert.setShopID(newCmShop.getShopID());
|
|
|
shopCert.setShopCertTypeID("1");//
|
|
|
shopCert.setName("荣誉证书");
|
|
|
shopCert.setImage(honorCertificate4);
|
|
|
- newCmShopDao.saveShopcert(shopCert);
|
|
|
- }
|
|
|
- if(StringUtils.isNotEmpty(honorCertificate5)){
|
|
|
- honorCertificate5 = getImageUrl(honorCertificate5);
|
|
|
- ShopCert shopCert = new ShopCert();
|
|
|
+ newCmShopDao.saveShopcert(shopCert);
|
|
|
+ }
|
|
|
+ if (StringUtils.isNotEmpty(honorCertificate5)) {
|
|
|
+ honorCertificate5 = getImageUrl(honorCertificate5);
|
|
|
+ ShopCert shopCert = new ShopCert();
|
|
|
shopCert.setShopID(newCmShop.getShopID());
|
|
|
shopCert.setShopCertTypeID("1");//
|
|
|
shopCert.setName("荣誉证书");
|
|
|
shopCert.setImage(honorCertificate5);
|
|
|
- newCmShopDao.saveShopcert(shopCert);
|
|
|
- }
|
|
|
- if(StringUtils.isNotEmpty(productionLicense)){
|
|
|
- productionLicense = getImageUrl(productionLicense);
|
|
|
- ShopCert shopCert = new ShopCert();
|
|
|
+ newCmShopDao.saveShopcert(shopCert);
|
|
|
+ }
|
|
|
+ if (StringUtils.isNotEmpty(productionLicense)) {
|
|
|
+ productionLicense = getImageUrl(productionLicense);
|
|
|
+ ShopCert shopCert = new ShopCert();
|
|
|
shopCert.setShopID(newCmShop.getShopID());
|
|
|
shopCert.setShopCertTypeID("2");
|
|
|
shopCert.setName("生产经营证书");
|
|
|
shopCert.setImage(productionLicense);
|
|
|
- newCmShopDao.saveShopcert(shopCert);
|
|
|
- }
|
|
|
- if(StringUtils.isNotEmpty(productCertificate)){
|
|
|
- productCertificate = getImageUrl(productCertificate);
|
|
|
- ShopCert shopCert = new ShopCert();
|
|
|
+ newCmShopDao.saveShopcert(shopCert);
|
|
|
+ }
|
|
|
+ if (StringUtils.isNotEmpty(productCertificate)) {
|
|
|
+ productCertificate = getImageUrl(productCertificate);
|
|
|
+ ShopCert shopCert = new ShopCert();
|
|
|
shopCert.setShopID(newCmShop.getShopID());
|
|
|
shopCert.setShopCertTypeID("3");
|
|
|
shopCert.setName("产品证书");
|
|
|
shopCert.setImage(productCertificate);
|
|
|
- newCmShopDao.saveShopcert(shopCert);
|
|
|
- }
|
|
|
- if(StringUtils.isNotEmpty(sanitationPermit)){
|
|
|
- sanitationPermit = getImageUrl(sanitationPermit);
|
|
|
- ShopCert shopCert = new ShopCert();
|
|
|
+ newCmShopDao.saveShopcert(shopCert);
|
|
|
+ }
|
|
|
+ if (StringUtils.isNotEmpty(sanitationPermit)) {
|
|
|
+ sanitationPermit = getImageUrl(sanitationPermit);
|
|
|
+ ShopCert shopCert = new ShopCert();
|
|
|
shopCert.setShopID(newCmShop.getShopID());
|
|
|
shopCert.setShopCertTypeID("5");
|
|
|
shopCert.setName("卫生许可");
|
|
|
shopCert.setImage(sanitationPermit);
|
|
|
- newCmShopDao.saveShopcert(shopCert);
|
|
|
- }
|
|
|
- if(StringUtils.isNotEmpty(taxPermit)){
|
|
|
- taxPermit = getImageUrl(taxPermit);
|
|
|
- ShopCert shopCert = new ShopCert();
|
|
|
+ newCmShopDao.saveShopcert(shopCert);
|
|
|
+ }
|
|
|
+ if (StringUtils.isNotEmpty(taxPermit)) {
|
|
|
+ taxPermit = getImageUrl(taxPermit);
|
|
|
+ ShopCert shopCert = new ShopCert();
|
|
|
shopCert.setShopID(newCmShop.getShopID());
|
|
|
shopCert.setShopCertTypeID("6");
|
|
|
shopCert.setName("税务许可");
|
|
|
shopCert.setImage(taxPermit);
|
|
|
- newCmShopDao.saveShopcert(shopCert);
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 获取商品图片服务器全路径
|
|
|
- * @param imageUrl
|
|
|
- * @return
|
|
|
- */
|
|
|
- public String getImageUrl(String imageUrl){
|
|
|
- String photoServer = Global.getConfig("photoServer");//获取文件服务器地址
|
|
|
- ImageUploadInfo saveImageSerivce = new ImageUploadInfo();
|
|
|
- if(StringUtils.isNotBlank(imageUrl) && !imageUrl.startsWith("http:") && !imageUrl.startsWith("https:")){
|
|
|
- imageUrl= Encodes.urlDecode(imageUrl);
|
|
|
- String realPath = UploadImageUtils.getAbsolutePath(imageUrl);
|
|
|
- int pointerIndex = realPath.lastIndexOf(".");
|
|
|
- try {
|
|
|
- saveImageSerivce = UploadUtils.saveImageSerivce(realPath, pointerIndex,realPath);
|
|
|
- imageUrl = photoServer + saveImageSerivce.getSource();
|
|
|
- } catch (Exception e) {
|
|
|
- logger.error("图片上传错误:"+e.toString(),e);
|
|
|
+ newCmShopDao.saveShopcert(shopCert);
|
|
|
+ }
|
|
|
+ if (null != newCmShop.getSplitCodes() && newCmShop.getSplitCodes().size() > 0) {
|
|
|
+ //删除旧分帐号
|
|
|
+ newCmShopDao.deleteSplitCode(newCmShop.getShopID());
|
|
|
+ for (SplitCode splitCode : newCmShop.getSplitCodes()) {
|
|
|
+ if(StringUtils.isNotBlank(splitCode.getSplitCode())){
|
|
|
+ splitCode.setShopId(newCmShop.getShopID());
|
|
|
+ //增加新分帐号
|
|
|
+ newCmShopDao.insertSplitCode(splitCode);
|
|
|
}
|
|
|
}
|
|
|
- return imageUrl;
|
|
|
- }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取商品图片服务器全路径
|
|
|
+ *
|
|
|
+ * @param imageUrl
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public String getImageUrl(String imageUrl) {
|
|
|
+ String photoServer = Global.getConfig("photoServer");//获取文件服务器地址
|
|
|
+ ImageUploadInfo saveImageSerivce = new ImageUploadInfo();
|
|
|
+ if (StringUtils.isNotBlank(imageUrl) && !imageUrl.startsWith("http:") && !imageUrl.startsWith("https:")) {
|
|
|
+ imageUrl = Encodes.urlDecode(imageUrl);
|
|
|
+ String realPath = UploadImageUtils.getAbsolutePath(imageUrl);
|
|
|
+ int pointerIndex = realPath.lastIndexOf(".");
|
|
|
+ try {
|
|
|
+ saveImageSerivce = UploadUtils.saveImageSerivce(realPath, pointerIndex, realPath);
|
|
|
+ imageUrl = photoServer + saveImageSerivce.getSource();
|
|
|
+ } catch (Exception e) {
|
|
|
+ logger.error("图片上传错误:" + e.toString(), e);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return imageUrl;
|
|
|
+ }
|
|
|
|
|
|
|
|
|
- @Transactional(readOnly = false)
|
|
|
- public void save(NewCmShop newCmShop) {
|
|
|
- super.save(newCmShop);
|
|
|
- }
|
|
|
+ @Transactional(readOnly = false)
|
|
|
+ public void save(NewCmShop newCmShop) {
|
|
|
+ super.save(newCmShop);
|
|
|
+ }
|
|
|
|
|
|
- @Transactional(readOnly = false)
|
|
|
- public void delete(NewCmShop newCmShop) {
|
|
|
- super.delete(newCmShop);
|
|
|
- }
|
|
|
+ @Transactional(readOnly = false)
|
|
|
+ public void delete(NewCmShop newCmShop) {
|
|
|
+ super.delete(newCmShop);
|
|
|
+ }
|
|
|
|
|
|
}
|