lihong 7 mesiacov pred
rodič
commit
fda4eab1f3

+ 1 - 24
src/main/java/cn/hnthyy/thmz/ThmzApplication.java

@@ -1,39 +1,16 @@
 package cn.hnthyy.thmz;
 
-import cn.hnthyy.thmz.webservice.lis.CriticalMessageServiceSoapImpl;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.boot.SpringApplication;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
 import org.springframework.boot.builder.SpringApplicationBuilder;
-import org.springframework.boot.web.servlet.ServletComponentScan;
 import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
-import org.springframework.context.annotation.ComponentScan;
-
-import javax.xml.ws.Endpoint;
-import java.net.InetAddress;
-//@ComponentScan(basePackages = {"cn.hnthyy.thmz.common.datasource"})
-//@ServletComponentScan
-//@EnableDiscoveryClient
 @SpringBootApplication
 @Slf4j
-//@MapperScan("cn.hnthyy.thmz.mapper")
 public class ThmzApplication extends SpringBootServletInitializer {
     public static void main(String[] args) {
-        log.info("服务启动成功");
         SpringApplication.run(ThmzApplication.class, args);
-
-                //发布webservice服务
-        try {
-            InetAddress ia=InetAddress.getLocalHost();
-            String localip=ia.getHostAddress();
-            String address = "http://"+localip+":7611/CriticalMessageService";
-            //发布WebService,WebServiceImpl类是WebServie接口的具体实现类
-            Endpoint.publish(address, new CriticalMessageServiceSoapImpl());
-            System.out.println("使用WebServicePublishListener发布webservice成功!");
-        } catch (Exception e) {
-            // TODO Auto-generated catch block
-            e.printStackTrace();
-        }
+        log.info("服务启动成功");
 
     }
 

+ 2 - 0
src/main/java/cn/hnthyy/thmz/controller/UserController.java

@@ -249,6 +249,8 @@ public class UserController {
     public Map<String, Object> getUserPage(@RequestBody UserVo userVo) {
         Map<String, Object> resultMap = new HashMap<>();
         try {
+            //复制 员工信息 和科室信息
+            userService.replicationEmp();
             List<UserRoleRelationVo> userRoleRelationVos = new ArrayList<>();
             int total = userService.countUser(userVo);
             List<User> users = userService.queryUserPage(userVo);

+ 1 - 0
src/main/java/cn/hnthyy/thmz/entity/thmz/UserDeptRelation.java

@@ -46,4 +46,5 @@ public class UserDeptRelation implements Serializable {
 	 */
 	private List<String> deptNos;
 
+
 }

+ 6 - 0
src/main/java/cn/hnthyy/thmz/mapper/thmz/UserDeptRelationMapper.java

@@ -34,4 +34,10 @@ public interface UserDeptRelationMapper {
      */
     @Delete("delete from t_user_dept_relation where user_id_code=#{userIdCode}")
     int deleteByUsertIdCode(@Param("userIdCode") String userIdCode);
+
+    @Insert(" insert into t_user_dept_relation (dept_no, user_id_code, op_id, op_date)\n" +
+            " select rtrim(dept_code), rtrim(code), '99999', getdate()\n" +
+            " from a_employee_mi t1 left join t_user_dept_relation t2 on t1.code = t2.user_id_code and t1.dept_code = t2.dept_no\n" +
+            "  where t2.dept_no is null ")
+    void replicationdept();
 }

+ 7 - 0
src/main/java/cn/hnthyy/thmz/mapper/thmz/UserMapper.java

@@ -172,4 +172,11 @@ public interface UserMapper {
     int updatePasswordByUserCode(User user);
     @Select("select password from t_user where user_code=#{userCode}")
     String selectPassword(String userCode);
+
+    @Insert(" insert into t_user (user_id_code, user_code, user_name, password, update_time," +
+            "                    status) " +
+            " select rtrim(code), rtrim(code_rs),rtrim(name),'xMpCOKC5I4INzFCab3WEmw==',getdate(),1 from a_employee_mi where isnull(del_flag,'0') = '0' and code not in(" +
+            "    select user_id_code from t_user" +
+            ")")
+    void replicationEmp();
 }

+ 13 - 0
src/main/java/cn/hnthyy/thmz/service/impl/his/zd/JcZdItemServiceImpl.java

@@ -9,6 +9,7 @@ import cn.hnthyy.thmz.mapper.his.yz.YzSequenceMapper;
 import cn.hnthyy.thmz.mapper.his.zd.JcZdItemMapper;
 import cn.hnthyy.thmz.mapper.his.zd.JyZdItemMapper;
 import cn.hnthyy.thmz.service.his.zd.JcZdItemService;
+import cn.hutool.core.util.StrUtil;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -64,7 +65,13 @@ public class JcZdItemServiceImpl implements JcZdItemService {
         }
         if(StringUtils.isBlank(jcZdItem.getCode())){
             String lastCode=jcZdItemMapper.selectLastCode();
+            if(StrUtil.isBlank(lastCode)){
+                lastCode = "0";
+            }
             String lastJyCode=jyZdItemMapper.selectLastCode();
+            if(StrUtil.isBlank(lastJyCode)){
+                lastJyCode = "0";
+            }
             if(Integer.parseInt(lastJyCode)>Integer.parseInt(lastCode)){
                 lastCode=lastJyCode;
             }
@@ -81,7 +88,13 @@ public class JcZdItemServiceImpl implements JcZdItemService {
             jcZdItem.setZyOrderCode(newZyCode);
             yzSequenceMapper.updateZyOrderCode(newZyCode,lastZyOrderCode);
             String lastMzCode=jcZdItemMapper.selectLastMzCode();
+            if(StrUtil.isBlank(lastMzCode)){
+                lastMzCode = "0";
+            }
             String lastJyMzCode=jyZdItemMapper.selectLastMzCode();
+            if(StrUtil.isBlank(lastJyMzCode)){
+                lastJyMzCode = "0";
+            }
             if(Integer.parseInt(lastJyMzCode)>Integer.parseInt(lastMzCode)){
                 lastMzCode=lastJyMzCode;
             }

+ 13 - 0
src/main/java/cn/hnthyy/thmz/service/impl/his/zd/JyZdItemServiceImpl.java

@@ -9,6 +9,7 @@ import cn.hnthyy.thmz.mapper.his.yz.YzSequenceMapper;
 import cn.hnthyy.thmz.mapper.his.zd.JcZdItemMapper;
 import cn.hnthyy.thmz.mapper.his.zd.JyZdItemMapper;
 import cn.hnthyy.thmz.service.his.zd.JyZdItemService;
+import cn.hutool.core.util.StrUtil;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -70,6 +71,12 @@ public class JyZdItemServiceImpl implements JyZdItemService {
         if(StringUtils.isBlank(jyZdItem.getCode())){
             String lastCode=jcZdItemMapper.selectLastCode();
             String lastJyCode=jyZdItemMapper.selectLastCode();
+            if(StrUtil.isBlank(lastCode)){
+                lastCode = "0";
+            }
+            if(StrUtil.isBlank(lastJyCode)){
+                lastJyCode = "0";
+            }
             if(Integer.parseInt(lastJyCode)>Integer.parseInt(lastCode)){
                 lastCode=lastJyCode;
             }
@@ -86,7 +93,13 @@ public class JyZdItemServiceImpl implements JyZdItemService {
             jyZdItem.setZyOrderCode(newZyCode);
             yzSequenceMapper.updateZyOrderCode(newZyCode,lastZyOrderCode);
             String lastMzCode=jcZdItemMapper.selectLastMzCode();
+            if(StrUtil.isBlank(lastMzCode)){
+                lastMzCode = "0";
+            }
             String lastJyMzCode=jyZdItemMapper.selectLastMzCode();
+            if(StrUtil.isBlank(lastJyMzCode)){
+                lastJyMzCode = "0";
+            }
             if(Integer.parseInt(lastJyMzCode)>Integer.parseInt(lastMzCode)){
                 lastMzCode=lastJyMzCode;
             }

+ 5 - 0
src/main/java/cn/hnthyy/thmz/service/impl/thmz/UserDeptRelationServiceImpl.java

@@ -36,4 +36,9 @@ public class UserDeptRelationServiceImpl implements UserDeptRelationService {
     public List<String> queryAllByUserIdCode(String userIdCode) {
         return userDeptRelationMapper.selectAllByUserIdCode(userIdCode);
     }
+
+    @Override
+    public void replicationdept() {
+        userDeptRelationMapper.replicationdept();
+    }
 }

+ 11 - 0
src/main/java/cn/hnthyy/thmz/service/impl/thmz/UserServiceImpl.java

@@ -16,6 +16,7 @@ import cn.hnthyy.thmz.mapper.thmz.UserDeptRelationMapper;
 import cn.hnthyy.thmz.mapper.thmz.UserMapper;
 import cn.hnthyy.thmz.service.thmz.MenuService;
 import cn.hnthyy.thmz.service.thmz.RoleMenuRelationService;
+import cn.hnthyy.thmz.service.thmz.UserDeptRelationService;
 import cn.hnthyy.thmz.service.thmz.UserRoleRelationService;
 import cn.hnthyy.thmz.service.thmz.UserService;
 import cn.hnthyy.thmz.vo.UserVo;
@@ -55,6 +56,8 @@ public class UserServiceImpl implements UserService {
     private RoleMenuRelationService rolMenuRelationService;
     @Resource
     private MenuService menuService;
+    @Resource
+    private UserDeptRelationService userDeptRelationService;
 
     @Override
     public List<User> queryAllUser() {
@@ -200,4 +203,12 @@ public class UserServiceImpl implements UserService {
         }
         return menuList.stream().map(Menu::getMenuUrl).collect(Collectors.toList());
     }
+
+    @Override
+    public void replicationEmp() {
+        userMapper.replicationEmp();
+        userDeptRelationService.replicationdept();
+    }
+
+
 }

+ 1 - 0
src/main/java/cn/hnthyy/thmz/service/thmz/UserDeptRelationService.java

@@ -22,4 +22,5 @@ public interface UserDeptRelationService {
      */
     List<String> queryAllByUserIdCode(String userIdCode);
 
+    void replicationdept();
 }

+ 2 - 0
src/main/java/cn/hnthyy/thmz/service/thmz/UserService.java

@@ -76,4 +76,6 @@ public interface UserService {
     String queryPassword(String userCode);
 
    List<String> getUserRoleUrls(Long userId);
+
+    void replicationEmp();
 }

+ 4 - 1
src/main/resources/otherSource/thyy_mz_system_sqlServer_init_data.sql

@@ -1,7 +1,7 @@
 INSERT INTO [t_user]( [user_id_code], [user_code], [user_name], [password], [id_card], [create_time],
                      [create_user], [update_time], [update_user], [status], [profile_image], [email], [phone_number],
                      [gender], [lock_screen_password], [client_profile_image])
-VALUES ( '03328', '4264', '管理员', 'xMpCOKC5I4INzFCab3WEmw==', '', '2023-06-26 08:37:45.000', -1,
+VALUES ( '03328', '0001', '超级管理员', 'xMpCOKC5I4INzFCab3WEmw==', '', '2023-06-26 08:37:45.000', -1,
         '2023-06-26 08:37:45.000', -1, 1, 921, '', '', '', '', 0);
 
 INSERT INTO [t_role]( [role_name], [remark], [create_time], [create_id], [update_time], [update_id], [del_flag]) VALUES ( '管理员', '为系统最大权限', '2021-05-06 10:03:24.000', 1, '2024-09-06 10:36:24.147', 1, '0');
@@ -10,6 +10,9 @@ INSERT INTO [t_role]( [role_name], [remark], [create_time], [create_id], [update
 INSERT INTO [t_user_role_relation]([user_id], [role_id], [create_time], [create_id])
 VALUES (1, 1, '2021-05-11 10:45:26.000', 1);
 
+insert into a_employee_mi(code,dept_code,name,emp_tit_code,code_rs)
+select user_id_code,'3100000',user_name,'001',user_code from t_user
+where user_id_code not in(select code from a_employee_mi);
 
 INSERT INTO [t_config]( [config_key], [config_value], [create_id], [create_date], [remark]) VALUES ('alarm_num', '10', 1, '2020-05-11 10:03:24.000', '号表剩余警告数');
 INSERT INTO [t_config]( [config_key], [config_value], [create_id], [create_date], [remark]) VALUES ('alarm_user', '01295,01566,01598,01853', 1, '2020-05-11 10:52:59.000', '号表剩余警告接收人');

+ 1 - 0
src/main/resources/static/js/user_manage.js

@@ -347,6 +347,7 @@ function queryParams(params) {
  * @param row
  */
 function editUser(row) {
+    console.log('进入editUser',row)
     clearInput();
     $("#classTitle").text("修改");
     $("#id").val(row.user.id);