pangjl 4 years ago
parent
commit
9cd82ff722

+ 6 - 1
src/main/java/com/minpay/shouhuo/equmentaction/MachineManageAction.java

@@ -205,6 +205,7 @@ public class MachineManageAction implements IMINAction {
     @MINAction(value = ADD_PROEQUREL_NUM, transaction = IMINTransactionEnum.CMT)
     public MINActionResult addProEquRelNum(
             @MINParam(key = "equId") String equId,
+            @MINParam(key = "proNum") String proNum,//补货数量
             MINSession session
     ) throws MINBusinessException {
 
@@ -235,7 +236,11 @@ public class MachineManageAction implements IMINAction {
                 .selectByExample(proEquRelExample);
         for (int i = 0; i < list2.size(); i++) {
             VmProEquRel equRel = list2.get(i);
-            equRel.setProductNums(equRel.getCargoWayNums());		//商品余量修改为货道容量
+            if(CommonUtil.compare(proNum,equRel.getCargoWayNums())== 0 || CommonUtil.compare(proNum,equRel.getCargoWayNums())==1 ){
+                equRel.setProductNums(equRel.getCargoWayNums());		//商品余量修改为货道容量
+            }else{
+                equRel.setProductNums(proNum);		//商品余量
+            }
             equRel.setModifyUser(userId);							//最后修改人
             equRel.setModifyTime(dateTime);							//最后修改时间
             Service.lookup(IMINDataBaseService.class)

+ 6 - 7
src/main/java/com/minpay/shouhuo/productaction/ProductManageAction.java

@@ -73,6 +73,7 @@ public class ProductManageAction implements IMINAction {
 			@MINParam(key = "categoryId") String categoryId,
 			@MINParam(key = "categoryName") String categoryName,
 			@MINParam(key = "createUser") String createUser,
+			@MINParam(key = "flag") String flag,
 			@MINParam(key = "page", defaultValue = "1") int page,
 			@MINParam(key = "limit", defaultValue = "3") int limit,
 			MINSession session) throws MINBusinessException {
@@ -89,14 +90,12 @@ public class ProductManageAction implements IMINAction {
 		map.put("createUser",createUser);
 		map.put("channel", user.getChannel());//渠道号
 		map.put("category", categoryId);//分类
-		//验证操作员权限
-//		if("00".equals(user.getIdentity())){
-			map.put("userId",user.getId());
-//			map.put("roId","10000001");
-//		}
-/*		if("10000002".equals(user.getRoleId())){
+		if (!CommonUtil.isEmpty(flag)){
+			map.put("branchId",user.getBranchId());
+		}else{
 			map.put("userId",user.getId());
-		}*/
+		}
+
 		//分页
 		MINRowBounds rows = new MINRowBounds(page, limit);
 		//执行查询

+ 5 - 1
src/main/resources/com/minpay/db/table/own/mapper/ProductManageMapper.xml

@@ -18,7 +18,8 @@
 			u.USR_NAME          'createUser',
 			p.PRT_CREATE_TIME   'createTime',
 			e.USR_NAME          'modifyUser',
-			p.PRT_MODIFY_TIME   'modifyTime'
+			p.PRT_MODIFY_TIME   'modifyTime',
+			p.PRT_BRANCHID 		'branchId'
      	FROM vm_product_inf  p
      		LEFT JOIN 	im_user u ON u.USR_ID = p.PRT_CREATE_USER
      			AND u.USR_CHANNEL = p.PRT_CHANNEL
@@ -41,6 +42,9 @@
 		<if test="createUser != null and createUser != ''"> 
 		 	AND u.USR_NAME like CONCAT('%', #{createUser,jdbcType=VARCHAR}, '%')
 		</if>
+		<if test="branchId != null and branchId != ''">
+			AND p.PRT_BRANCHID = #{branchId,jdbcType=VARCHAR}
+		</if>
 		<if test=" userId != null and userId != ''"> 
 		 	AND (p.PRT_CREATE_USER = #{userId,jdbcType=VARCHAR} or rel.URR_ROLEID = #{roId,jdbcType=VARCHAR})
 		</if>