소스 검색

添加同步新项目功能(为新增的项目的new_name字段赋值)

lighter 4 년 전
부모
커밋
dceaf61e64

+ 1 - 1
pom.xml

@@ -10,7 +10,7 @@
     </parent>
     <groupId>thyyxxk</groupId>
     <artifactId>web-server</artifactId>
-    <version>9.6.2</version>
+    <version>9.6.3</version>
     <name>web-server</name>
     <description>server for yibao-web</description>
     <properties>

+ 6 - 4
src/main/java/thyyxxk/webserver/controller/nationalmatch/NationalMatchController.java

@@ -1,10 +1,7 @@
 package thyyxxk.webserver.controller.nationalmatch;
 
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
 import thyyxxk.webserver.entity.ResultVo;
 import thyyxxk.webserver.entity.nationalmatch.QueryParam;
 import thyyxxk.webserver.entity.nationalmatch.StandardLocalItem;
@@ -33,6 +30,11 @@ public class NationalMatchController {
         return service.selectLocalItems(param);
     }
 
+    @GetMapping("/asyncNewNameForServices")
+    public ResultVo<String> asyncNewNameForServices() {
+        return service.asyncNewNameForServices();
+    }
+
     @PostMapping("/selectNationalItems")
     public ResultVo<List> selectNationalItems(@RequestBody StandardLocalItem param) {
         return service.selectNationalItems(param);

+ 3 - 0
src/main/java/thyyxxk/webserver/dao/his/nationalmatch/NationalMatchDao.java

@@ -71,6 +71,9 @@ public interface NationalMatchDao {
                                                  @Param("delFlag") int delFlag,
                                                  @Param("status") int status);
 
+    @Update("update zd_charge_item set new_name=name where new_name is null")
+    void asyncNewNameForServices();
+
     @Select("select * from si_central_medicine where national_name=#{name} and approval_number like #{approve}")
     List<SiCentralMedicine> selectNationalMedicines(@Param("name") String name,
                                                     @Param("approve") String approve);

+ 5 - 0
src/main/java/thyyxxk/webserver/service/nationalmatch/NationalMatchService.java

@@ -58,6 +58,11 @@ public class NationalMatchService {
         return ResultVoUtil.success(map);
     }
 
+    public ResultVo<String> asyncNewNameForServices() {
+        dao.asyncNewNameForServices();
+        return ResultVoUtil.success("同步成功。");
+    }
+
     public ResultVo<List> selectNationalItems(StandardLocalItem param) {
         int type = param.getType();
         if (type == NationalMatchType.MEDICINE) {