shenji преди 1 година
родител
ревизия
9b3f69c3e1

+ 5 - 1
jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/oa/service/impl/MaterialInDetailServiceImpl.java

@@ -40,7 +40,11 @@ public class MaterialInDetailServiceImpl extends ServiceImpl<MaterialInDetailMap
             return false;
         }
         super.save(entity);
-        material.setQuantity(material.getQuantity().add(entity.getQuantity()));
+        if (material.getQuantity() != null) {
+            material.setQuantity(material.getQuantity().add(entity.getQuantity()));
+        }else {
+            material.setQuantity(entity.getQuantity());
+        }
         return materialService.saveOrUpdate(material);
     }
 

+ 13 - 0
jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/controller/SysUserController.java

@@ -1926,4 +1926,17 @@ public class SysUserController {
         List<SysUserEdu> sysUserEduList = sysUserEduService.selectByMainId(id);
         return Result.ok(sysUserEduList);
     }
+
+
+    @AutoLog(value = "用户-查询财务负责人")
+    @ApiOperation(value="用户-查询财务负责人", notes="用户-查询财务负责人")
+    @GetMapping(value = "/queryFinanceManager")
+    public Result<?> queryFinanceManager(@RequestParam(name="position",required=true) String position) {
+        SysUser sysUser = sysUserService.queryByPost(position);
+        if(sysUser==null) {
+            return Result.error("未找到对应数据");
+        }
+        return Result.ok(sysUser);
+
+    }
 }

+ 3 - 2
jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/mapper/SysUserMapper.java

@@ -1,17 +1,16 @@
 package org.jeecg.modules.system.mapper;
 
 import com.baomidou.mybatisplus.core.conditions.Wrapper;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.core.toolkit.Constants;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import org.apache.ibatis.annotations.Param;
 import org.jeecg.modules.system.entity.SysUser;
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import org.jeecg.modules.system.model.SysUserSysDepartModel;
 import org.jeecg.modules.system.vo.CodeVo;
 import org.jeecg.modules.system.vo.SysUserDepVo;
 
-import java.util.Date;
 import java.util.List;
 
 /**
@@ -194,4 +193,6 @@ public interface SysUserMapper extends BaseMapper<SysUser> {
 	 * @param seqName
 	 */
 	int updateNextNoByNYR(String seqName);
+
+    SysUser getUserByPostName(String position);
 }

+ 5 - 1
jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/mapper/xml/SysUserMapper.xml

@@ -243,7 +243,7 @@
 		CALL nextSeqNo(#{seqName,mode=IN},#{seqNo,mode=OUT,jdbcType=BIGINT})
 	</select>
 
-	<update id="updateNextNoByNYR">
+    <update id="updateNextNoByNYR">
 		update sys_dict_item set item_value=0 ,update_time = now() where item_text = #{seqName}
 		and (update_time is null or DATE_FORMAT(update_time,'%Y-%m-%d') != DATE_FORMAT(NOW(),'%Y-%m-%d') )
 	</update>
@@ -252,4 +252,8 @@
 		update sys_dict_item set item_value=0 ,update_time = now() where item_text = #{seqName}
 		and (update_time is null or DATE_FORMAT(update_time,'%Y-%m') != DATE_FORMAT(NOW(),'%Y-%m') )
 	</update>
+
+	<select id="getUserByPostName" resultType="org.jeecg.modules.system.entity.SysUser">
+		SELECT u.* FROM sys_user u LEFT JOIN sys_position p on u.post = p.code WHERE p.name = #{position}  and del_flag = '0'  LIMIT 1
+	</select>
 </mapper>

+ 2 - 0
jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/service/ISysUserService.java

@@ -273,4 +273,6 @@ public interface ISysUserService extends IService<SysUser> {
 	 * 批量删除一对多
 	 */
 	public void delBatchMain (Collection<? extends Serializable> idList);
+
+    SysUser queryByPost(String position);
 }

+ 8 - 0
jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/service/impl/SysUserServiceImpl.java

@@ -536,4 +536,12 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
 			userMapper.deleteById(id);
 		}
 	}
+
+    @Override
+    public SysUser queryByPost(String position) {
+		if (StringUtils.isBlank(position)) {
+			return null;
+		}
+		return userMapper.getUserByPostName(position);
+    }
 }