Browse Source

修改标签规则

zangguocen 4 years ago
parent
commit
76ffc201b7

+ 3 - 1
yijia-label/src/main/java/com/yijia/label/controller/CustomerLabelController.java

@@ -82,6 +82,7 @@ public class CustomerLabelController extends BaseController
     {
         LoginUser currentUser = SecurityUtils.getLoginUser();
         customerLabel.setStationId(currentUser.getUser().getDeptId());
+        customerLabel.setDelFlag("0");
         ResponeCustomerLabel responeCustomerLabel =new ResponeCustomerLabel();
         List<CustomerLabel> notlist = customerLabelService.selectNotCustomerLabelInfo(customerLabel);
         List<String> list = customerLabelService.selectPhoneList(customerLabel);
@@ -100,8 +101,8 @@ public class CustomerLabelController extends BaseController
     {
         LoginUser currentUser = SecurityUtils.getLoginUser();
         customerLabel.setStationId(currentUser.getUser().getDeptId());
+        customerLabel.setDelFlag("0");
         List<CustomerLabel> notlist = customerLabelService.selectNotCustomerLabelInfo(customerLabel);
-
         return getDataTable(notlist);
     }
 
@@ -114,6 +115,7 @@ public class CustomerLabelController extends BaseController
     public TableDataInfo selectPhoneList(CustomerLabel customerLabel)
     {
         LoginUser currentUser = SecurityUtils.getLoginUser();
+        customerLabel.setDelFlag("0");
         customerLabel.setStationId(currentUser.getUser().getDeptId());
         List<String> list = customerLabelService.selectPhoneList(customerLabel);
         return getDataTable(list);

+ 2 - 1
yijia-label/src/main/java/com/yijia/label/controller/LabelRuleDetailController.java

@@ -8,6 +8,7 @@ import com.yijia.common.utils.SecurityUtils;
 import com.yijia.label.domain.LabelRule;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.transaction.annotation.Transactional;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.PutMapping;
@@ -106,11 +107,11 @@ public class LabelRuleDetailController extends BaseController
 
     @Log(title = "积分商品管理", businessType = BusinessType.UPDATE)
     @PostMapping(value ="/deleteLabelRuleDetail")
+    @Transactional
     public AjaxResult deleteLabelRuleDetail(@RequestBody LabelRuleDetail labelRuleDetail)
     {
         int i=0;
         try {
-            System.out.println("------------------------------------"+labelRuleDetail.getId());
             LoginUser currentUser = SecurityUtils.getLoginUser();
             labelRuleDetail.setDelFlag("1");
             labelRuleDetail.setUpdateBy(currentUser.getUser().getUserId()+"");

+ 3 - 0
yijia-label/src/main/resources/mapper/label/CustomerLabelMapper.xml

@@ -27,6 +27,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="phone != null  and phone != ''"> and phone like concat('%', #{phone}, '%')</if>
             <if test="labelId != null "> and label_id = #{labelId}</if>
             <if test="stationId != null "> and station_id = #{stationId}</if>
+            <if test="delFlag != null "> and del_flag = #{delFlag}</if>
         </where>
     </select>
 
@@ -42,6 +43,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         ( select phone from customer_label b
         <where>
             <if test="labelId != null "> and label_id != #{labelId}</if>
+            <if test="delFlag != null "> and del_flag = #{delFlag}</if>
         </where>  )
     </select>
     <select id="selectCustomerLabelById" parameterType="Integer" resultMap="CustomerLabelResult">
@@ -55,6 +57,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="phone != null  and phone != ''"> and phone = #{phone}</if>
             <if test="labelId != null "> and label_id = #{labelId}</if>
             <if test="stationId != null "> and station_id = #{stationId}</if>
+            <if test="delFlag != null "> and del_flag = #{delFlag}</if>
         </where>
          limit 1
     </select>