Pārlūkot izejas kodu

消防站点信息完善

yq 3 gadi atpakaļ
vecāks
revīzija
71651a0811

+ 2 - 2
mhfire-controller/src/main/java/com/bizmatics/mhfire/controller/MybatisGeneratorUtils.java

@@ -44,7 +44,7 @@
 //        //2、数据源配置
 //        //修改数据源
 //        DataSourceConfig dsc = new DataSourceConfig();
-//        dsc.setUrl("jdbc:mysql://101.133.214.75:3306/mhfire?useUnicode=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=UTC&characterEncoding=utf8");
+//        dsc.setUrl("jdbc:mysql://101.133.214.75:3306/minhangsystem?useUnicode=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=UTC&characterEncoding=utf8");
 //        dsc.setDriverName("com.mysql.jdbc.Driver");
 //        dsc.setUsername("root");
 //        dsc.setPassword("123456");
@@ -71,7 +71,7 @@
 //        // strategy.setTablePrefix("t_"); // 表名前缀
 //        strategy.setEntityLombokModel(true); //使用lombok
 //        //修改自己想要生成的表
-//        strategy.setInclude("device","device_aj","device_info","device_alert");  // 逆向工程使用的表   如果要生成多个,这里可以传入String[]
+//        strategy.setInclude("zsk_team");  // 逆向工程使用的表   如果要生成多个,这里可以传入String[]
 //        mpg.setStrategy(strategy);
 //
 //        // 关闭默认 xml 生成,调整生成 至 根目录

+ 6 - 3
mhfire-controller/src/main/java/com/bizmatics/mhfire/controller/web/XfzWxzController.java

@@ -12,6 +12,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.RestController;
 
+import java.util.Date;
 import java.util.List;
 
 /**
@@ -44,12 +45,14 @@ public class XfzWxzController {
 
     /**
      * get one
-     * @param id id
+     * @param id 消防中队id
      * @return
      */
     @GetMapping("/one")
-    public ApiResult<List<JcjZzclxx>> getOne(@RequestParam String id){
-        return ApiResult.success(xfzWxzService.getOne(id));
+    public ApiResult<List<JcjZzclxx>> getOne(@RequestParam String id,
+                                             @RequestParam(required = false) Date startTime,
+                                             @RequestParam(required = false) Date endTime){
+        return ApiResult.success(xfzWxzService.getOne(id,startTime,endTime));
     }
 }
 

+ 2 - 1
mhfire-service/src/main/java/com/bizmatics/mhfire/service/XfzWxzService.java

@@ -5,6 +5,7 @@ import com.bizmatics.common.mvc.base.CrudService;
 import com.bizmatics.mhfire.model.JcjZzclxx;
 import com.bizmatics.mhfire.model.XfzWxz;
 
+import java.util.Date;
 import java.util.List;
 
 /**
@@ -29,5 +30,5 @@ public interface XfzWxzService extends CrudService<XfzWxz> {
      * @param id
      * @return
      */
-    List<JcjZzclxx> getOne(String id);
+    List<JcjZzclxx> getOne(String id, Date startTime, Date endTime);
 }

+ 12 - 2
mhfire-service/src/main/java/com/bizmatics/mhfire/service/impl/XfzWxzServiceImpl.java

@@ -6,16 +6,21 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.bizmatics.common.core.bean.CommonPage;
+import com.bizmatics.common.core.exception.BusinessException;
 import com.bizmatics.common.mvc.base.AbstractCrudService;
 import com.bizmatics.mhfire.model.JcjZzclxx;
 import com.bizmatics.mhfire.model.XfzWxz;
+import com.bizmatics.mhfire.model.ZskTeam;
 import com.bizmatics.mhfire.persistence.mapper.XfzWxzMapper;
 import com.bizmatics.mhfire.service.JcjZzclxxService;
 import com.bizmatics.mhfire.service.XfzWxzService;
+import com.bizmatics.mhfire.service.ZskTeamService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import java.util.Date;
 import java.util.List;
+import java.util.Optional;
 
 /**
  * <p>
@@ -31,6 +36,8 @@ public class XfzWxzServiceImpl extends AbstractCrudService<XfzWxzMapper, XfzWxz>
 
     @Autowired
     private JcjZzclxxService jcjZzclxxService;
+    @Autowired
+    private ZskTeamService zskTeamService;
     @Override
     public CommonPage<XfzWxz> page(Integer current, Integer size) {
         IPage<XfzWxz> page = new Page<>(current, size);
@@ -40,9 +47,12 @@ public class XfzWxzServiceImpl extends AbstractCrudService<XfzWxzMapper, XfzWxz>
     }
 
     @Override
-    public List<JcjZzclxx> getOne(String id) {
+    public List<JcjZzclxx> getOne(String zdId, Date startTime,Date endTime) {
+        ZskTeam zskTeam = zskTeamService.getById(zdId);
+        Optional.ofNullable(zskTeam).orElseThrow(() -> new BusinessException("中队数据为空"));
         LambdaQueryWrapper<JcjZzclxx> queryWrapper = Wrappers.lambdaQuery();
-        queryWrapper.eq(JcjZzclxx::getJgxxXfjgId,id);
+        queryWrapper.eq(JcjZzclxx::getJgxxXfjgId,zskTeam.getXfjgId());
+        queryWrapper.between(JcjZzclxx::getTssj,startTime,endTime);
         return jcjZzclxxService.list(queryWrapper);
     }
 }