kaiyu
2022-05-11 c4c7be7e619761aaab55055c1b5e9ffa9bd91068
screen-api
增加企业整顿导出接口
3 files modified
29 ■■■■■ changed files
screen-api/src/main/java/com/moral/api/controller/RectifyController.java 12 ●●●●● patch | view | raw | blame | history
screen-api/src/main/java/com/moral/api/service/RectifyService.java 3 ●●●●● patch | view | raw | blame | history
screen-api/src/main/java/com/moral/api/service/impl/RectifyServiceImpl.java 14 ●●●●● patch | view | raw | blame | history
screen-api/src/main/java/com/moral/api/controller/RectifyController.java
@@ -13,6 +13,8 @@
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
@@ -63,6 +65,16 @@
        return ResultMessage.ok(response);
    }
    @GetMapping("exportRectify")
    public ResultMessage exportRectify(HttpServletRequest request) {
        Map<String, Object> params = WebUtils.getParametersStartingWith(request, null);
        if (params.get("cityCode") == null || params.get("time") == null) {
            return ResultMessage.fail(ResponseCodeEnum.PARAMETERS_IS_MISSING.getCode(), ResponseCodeEnum.PARAMETERS_IS_MISSING.getMsg());
        }
        List<Rectify> rectifies = rectifyService.exportRectifyByCityCode(params);
        return ResultMessage.ok(rectifies);
    }
    @PostMapping("updateRectify")
    public ResultMessage updateRectify(@RequestBody Rectify rectify) {
        if (rectify.getId() == null) {
screen-api/src/main/java/com/moral/api/service/RectifyService.java
@@ -28,4 +28,7 @@
    //根据id删除
    int deleteRectify(Integer id);
    //导出
    List<Rectify> exportRectifyByCityCode(Map<String, Object> params);
}
screen-api/src/main/java/com/moral/api/service/impl/RectifyServiceImpl.java
@@ -63,6 +63,20 @@
    }
    @Override
    public List<Rectify> exportRectifyByCityCode(Map<String, Object> params) {
        //获取请求参数
        Integer cityCode = Integer.parseInt(params.get("cityCode").toString());
        String time = params.get("time").toString();
        QueryWrapper<Rectify> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("city_code", cityCode)
                .eq("is_delete", Constants.NOT_DELETE)
                .likeRight("create_time", time);
        List<Rectify> rectifies = rectifyMapper.selectList(queryWrapper);
        return rectifies;
    }
    @Override
    public int updateRectify(Rectify rectify) {
        UpdateWrapper<Rectify> wrapper = new UpdateWrapper<>();
        wrapper.eq("id", rectify.getId());