Jelajahi Sumber

优化默认的油站信息

zangguocen 4 tahun lalu
induk
melakukan
0931aa4892

+ 7 - 4
yijia-system/src/main/java/com/yijia/system/service/impl/SysDeptServiceImpl.java

@@ -26,10 +26,10 @@ import com.yijia.system.service.ISysDeptService;
 @Service
 public class SysDeptServiceImpl implements ISysDeptService
 {
-    @Autowired
+    @Autowired(required = false)
     private SysDeptMapper deptMapper;
 
-    @Autowired
+    @Autowired(required = false)
     private SysRoleMapper roleMapper;
 
     /**
@@ -182,8 +182,7 @@ public class SysDeptServiceImpl implements ISysDeptService
     {
         SysDept info = deptMapper.selectDeptById(dept.getParentId());
         // 如果父节点不为正常状态,则不允许新增子节点
-        if (!UserConstants.DEPT_NORMAL.equals(info.getStatus()))
-        {
+        if (!UserConstants.DEPT_NORMAL.equals(info.getStatus())){
             throw new CustomException("部门停用,不允许新增");
         }
         if(dept.getJiBie()!=null && dept.getJiBie() == 2){
@@ -194,10 +193,14 @@ public class SysDeptServiceImpl implements ISysDeptService
             dept.setDiscountSetting("0");
             dept.setIntegralPrintFlag("1");
             dept.setIntegralFlag("1");
+            dept.setLabelFlag("0");
+            dept.setPrintDeviceType("0");
         }else if(dept.getJiBie()!=null && dept.getJiBie()==1){
+            dept.setAncestors(info.getAncestors() + "," + dept.getParentId());
             dept.setCardRuleFlag("0");
             dept.setIntegralRuleFlag("0");
             dept.setCouponFlag("0");
+            dept.setIntegralFlag("0");
         }
         return deptMapper.insertDept(dept);
     }

+ 9 - 4
yijia-system/src/main/resources/mapper/system/SysDeptMapper.xml

@@ -50,6 +50,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 		<result property="integralRuleFlag"    column="integral_rule_flag"    />
 		<result property="cardRuleFlag"    column="card_rule_flag"    />
 		<result property="couponFlag"    column="coupon_flag"    />
+		<result property="labelFlag"    column="label_flag"    />
+		<result property="printDeviceType"    column="print_device_type" />
 	</resultMap>
 
 	<sql id="selectDeptVo">
@@ -57,7 +59,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         d.del_flag, d.create_by, d.create_time ,d.ji_bie, d.dept_address, d.oil_gun_num, d.station_pic, d.station_longitude,
         d.station_latitude, d.mno, discount_setting,card_enabled_flag,d.app_id, d.app_secret,gzh_app_id,gzh_app_secret,ali_app_id,gzh_app_secret
         ali_app_id,ali_public_key,ali_private_key,ali_encrypt_key,image1,image2,image3,image4,image5,ws_print_flag,print_setting,notice,integral_print_flag,
-        d.integral_flag,d.integral_rule_flag,d.card_rule_flag,d.coupon_flag
+        d.integral_flag,d.integral_rule_flag,d.card_rule_flag,d.coupon_flag,d.label_flag,d.print_device_type
         from sys_dept d
     </sql>
 
@@ -149,9 +151,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 		where dept_name=#{deptName} and parent_id = #{parentId} limit 1
 	</select>
     <!--调用存储过程-->
-<!--	<select id="selectDeptListTree" statementType="CALLABLE" useCache="false">
-		{call deptinfo()};
-	</select>-->
 	<select id="getGroupInfo" resultMap="SysDeptResult">
 		<include refid="selectDeptVo"/>
 		<where>
@@ -206,6 +205,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 			<if test="integralRuleFlag != null">integral_rule_flag,</if>
 			<if test="cardRuleFlag != null">card_rule_flag,</if>
 			<if test="couponFlag != null">coupon_flag,</if>
+			<if test="labelFlag != null">label_flag,</if>
+			<if test="printDeviceType != null">print_device_type,</if>
  			create_time
  		)values(
  			<if test="deptId != null and deptId != 0">#{deptId},</if>
@@ -248,6 +249,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 			<if test="integralRuleFlag != null">#{integralRuleFlag},</if>
 			<if test="cardRuleFlag != null">#{cardRuleFlag},</if>
 			<if test="couponFlag != null">#{couponFlag},</if>
+			<if test="labelFlag != null">#{labelFlag},</if>
+			<if test="printDeviceType != null">#{printDeviceType},</if>
  			sysdate()
  		)
 	</insert>
@@ -294,6 +297,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 			<if test="integralRuleFlag != null">integral_rule_flag= #{integralRuleFlag},</if>
 			<if test="cardRuleFlag != null">card_rule_flag= #{cardRuleFlag},</if>
 			<if test="couponFlag != null">coupon_flag= #{couponFlag},</if>
+			<if test="labelFlag != null">label_flag= #{labelFlag},</if>
+			<if test="printDeviceType != null">print_device_type= #{printDeviceType},</if>
  			update_time = sysdate()
  		</set>
  		where dept_id = #{deptId}