yujian
2019-03-25 31f64845425a6ca1b6003ba77d01bafdbdacb8e2
fanli/src/main/java/com/yeshi/fanli/controller/admin/homemodule/SpecialCardAdminController.java
@@ -7,8 +7,6 @@
import javax.annotation.Resource;
import net.sf.json.JSONObject;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
@@ -22,17 +20,19 @@
import com.yeshi.fanli.entity.bus.homemodule.SpecialCard;
import com.yeshi.fanli.entity.bus.homemodule.SuperSpecialCard;
import com.yeshi.fanli.entity.common.JumpDetailV2;
import com.yeshi.fanli.entity.system.System;
import com.yeshi.fanli.entity.system.BusinessSystem;
import com.yeshi.fanli.service.AdminUserService;
import com.yeshi.fanli.service.inter.common.JumpDetailV2Service;
import com.yeshi.fanli.service.inter.config.BusinessSystemService;
import com.yeshi.fanli.service.inter.config.SystemConfigService;
import com.yeshi.fanli.service.inter.config.SystemService;
import com.yeshi.fanli.service.inter.homemodule.SpecialCardService;
import com.yeshi.fanli.service.inter.homemodule.SpecialService;
import com.yeshi.fanli.service.inter.homemodule.SuperSpecialCardService;
import com.yeshi.fanli.tag.PageEntity;
import com.yeshi.fanli.util.Constant;
import com.yeshi.fanli.util.StringUtil;
import net.sf.json.JSONObject;
@Controller
@RequestMapping("admin/new/api/v1/specialcard")
@@ -57,7 +57,7 @@
   private AdminUserService adminUserService;
   
   @Resource
   private SystemService systemService;
   private BusinessSystemService businessSystemService;
   
   
   
@@ -86,9 +86,9 @@
         specialCard.setUpdatetime(nowTime);
         specialCardService.insert(specialCard);
         
         List<System> systemList = systemService.getSystems();
         List<BusinessSystem> systemList = businessSystemService.getBusinessSystems();
         if (systemList != null && systemList.size() > 0) {
            for (System system: systemList) {
            for (BusinessSystem system: systemList) {
               SuperSpecialCard superCard = new  SuperSpecialCard();
               superCard.setSpecialCard(specialCard);
               superCard.setSystem(system);
@@ -224,7 +224,7 @@
            SpecialCard specialCard = new SpecialCard();
            specialCard.setId(cardId);
            
            System system = new System();
            BusinessSystem system = new BusinessSystem();
            system.setId(systemId);
            
            SuperSpecialCard superCard = new  SuperSpecialCard();
@@ -443,17 +443,11 @@
         }
         
         String params = record.getParams();
         if (params != null && params.trim().length() == 0) {
            params = null;
         }
         if (!StringUtil.isNullOrEmpty(params)) {
            String jumpValue = systemConfigService.get("jump");
            if (StringUtil.isNullOrEmpty(jumpValue)) {
               jumpValue = "{\"url\":\"#\"}";
            }
            params = jumpValue.replace("#", params);
         }
         
@@ -464,21 +458,25 @@
            } 
         }
         
         String name = record.getName();
         if (name != null && name.trim().length() == 0) {
            name = null;
         if (name != null && name.trim().length() > 0) {
            resultObj.setName(name);
         }
         if (params != null && params.trim().length() > 0) {
            resultObj.setParams(params);
         }
         String showType = record.getShowType();
         if (showType != null && showType.trim().length() > 0) {
            resultObj.setShowType(record.getShowType());
         }
         
         String remark = record.getRemark();
         if (remark != null && remark.trim().length() == 0) {
            remark = null;
         if (remark != null && remark.trim().length() > 0) {
            resultObj.setRemark(remark);
         }
         resultObj.setName(name);
         resultObj.setParams(params);
         resultObj.setShowType(record.getShowType());
         resultObj.setRemark(remark);
         
         specialService.updateByPrimaryKey(resultObj);