对比新文件 |
| | |
| | | package com.gk.firework.Controller; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.gk.firework.Controller.Base.BaseController; |
| | | import com.gk.firework.Domain.*; |
| | | import com.gk.firework.Domain.Utils.Msg; |
| | | import com.gk.firework.Domain.Utils.PageInfo; |
| | | import com.gk.firework.Domain.Utils.StringUtils; |
| | | import com.gk.firework.Domain.Vo.NoEntryVo; |
| | | import com.gk.firework.Domain.Vo.WarnContentVo; |
| | | import com.gk.firework.Service.*; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Calendar; |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | |
| | | @Api(tags = "流向预警接口") |
| | | @RestController |
| | | public class WarningController extends BaseController { |
| | | @Autowired |
| | | WarningService warningService; |
| | | @Autowired |
| | | WarnContentService warnContentService; |
| | | @Autowired |
| | | UserService userService; |
| | | @Autowired |
| | | EnterpriseService enterpriseService; |
| | | @Autowired |
| | | SaleOrderDetailService saleOrderDetailService; |
| | | @Autowired |
| | | StockService stockService; |
| | | |
| | | private final String WARN_TYPE_ENTRY = "超期未入库"; |
| | | private final String WARN_TYPE_CERT = "运输证超期"; |
| | | |
| | | @GetMapping("/warning") |
| | | @ApiOperation(value = "获取报警阈值",response = Msg.class) |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "pageIndex",value = "当前页码"), |
| | | @ApiImplicitParam(name = "pageSize",value = "每页行数"), |
| | | @ApiImplicitParam(name = "sort",value = "排序规则"), |
| | | @ApiImplicitParam(name = "order",value = "排序字段"), |
| | | @ApiImplicitParam(name = "warntype",value = "警告类型"), |
| | | @ApiImplicitParam(name = "enterprisetype",value = "企业类型"), |
| | | }) |
| | | public Msg getWarningList(@RequestParam(defaultValue = "0") Integer pageIndex, @RequestParam(defaultValue = "20") Integer pageSize, String sort, String order, |
| | | String warntype, String enterprisetype){ |
| | | Msg msg = new Msg(); |
| | | msg.setCode("200"); |
| | | msg.setMessage("success"); |
| | | |
| | | PageInfo pageInfo = new PageInfo(pageIndex, pageSize,sort,order); |
| | | HashMap<String, Object> condition = new HashMap<String, Object>(); |
| | | |
| | | if (StringUtils.isNotBlank(warntype)) { |
| | | condition.put("warntype", warntype.trim()); |
| | | } |
| | | |
| | | if (StringUtils.isNotBlank(enterprisetype)) { |
| | | condition.put("enterprisetype", enterprisetype.trim()); |
| | | } |
| | | |
| | | pageInfo.setCondition(condition); |
| | | warningService.selectDataGrid(pageInfo); |
| | | msg.setResult(pageInfo); |
| | | return msg; |
| | | } |
| | | |
| | | @PostMapping("/warning") |
| | | @ApiOperation(value = "修改报警阈值",response = Msg.class) |
| | | public Msg editWarningInfo(@RequestBody WarningInfo warningInfo){ |
| | | Msg msg = new Msg(); |
| | | msg.setCode("200"); |
| | | msg.setMessage("success"); |
| | | |
| | | if (warningInfo.getMinimum() == null){ |
| | | msg.setCode("999"); |
| | | msg.setMessage("预警值不能为空"); |
| | | return msg; |
| | | }else if (warningInfo.getMaximum() == null){ |
| | | msg.setCode("999"); |
| | | msg.setMessage("报警值不能为空"); |
| | | return msg; |
| | | }else if (warningInfo.getIssms() == null){ |
| | | msg.setCode("999"); |
| | | msg.setMessage("报警是否开启短信通知不能为空"); |
| | | return msg; |
| | | } |
| | | if (warningInfo.getWarntype().equals("购买超量") && warningInfo.getPeriod() == null){ |
| | | msg.setCode("999"); |
| | | msg.setMessage("计算周期不能为空"); |
| | | return msg; |
| | | } |
| | | |
| | | warningInfo.setModifiedby(getUser().getUsername()); |
| | | warningInfo.setModifieddate(new Date()); |
| | | warningService.updateById(warningInfo); |
| | | return msg; |
| | | } |
| | | |
| | | @GetMapping("/stockWarning") |
| | | @ApiOperation(value = "获取库存超量",response = Msg.class) |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "pageIndex",value = "当前页码"), |
| | | @ApiImplicitParam(name = "pageSize",value = "每页行数"), |
| | | @ApiImplicitParam(name = "sort",value = "排序规则"), |
| | | @ApiImplicitParam(name = "order",value = "排序字段"), |
| | | @ApiImplicitParam(name = "warnlevel",value = "警告级别"), |
| | | @ApiImplicitParam(name = "enterprisetype",value = "企业类型"), |
| | | @ApiImplicitParam(name = "enterprisename",value = "企业名称"), |
| | | @ApiImplicitParam(name = "starttime",value = "开始时间"), |
| | | @ApiImplicitParam(name = "endtime",value = "结束时间"), |
| | | @ApiImplicitParam(name = "province",value = "省份"), |
| | | @ApiImplicitParam(name = "city",value = "城市"), |
| | | @ApiImplicitParam(name = "area",value = "区县"), |
| | | @ApiImplicitParam(name = "town",value = "乡镇"), |
| | | @ApiImplicitParam(name = "community",value = "社区"), |
| | | @ApiImplicitParam(name = "ismend",value = "是否处理"), |
| | | }) |
| | | public Msg getStockWarningList(@RequestParam(defaultValue = "0") Integer pageIndex, @RequestParam(defaultValue = "20") Integer pageSize, String sort, String order, |
| | | String warnlevel, String enterprisetype, String enterprisename, String starttime, String endttime, |
| | | String province, String city, String area, String town, String community, Byte ismend){ |
| | | Msg msg = new Msg(); |
| | | msg.setCode("200"); |
| | | msg.setMessage("success"); |
| | | |
| | | PageInfo pageInfo = new PageInfo(pageIndex, pageSize,sort,order); |
| | | HashMap<String, Object> condition = new HashMap<String, Object>(); |
| | | |
| | | if (StringUtils.isNotBlank(warnlevel)) { |
| | | condition.put("warnlevel", warnlevel.trim()); |
| | | } |
| | | |
| | | if (StringUtils.isNotBlank(enterprisetype)) { |
| | | condition.put("enterprisetype", enterprisetype.trim()); |
| | | } |
| | | |
| | | if (StringUtils.isNotBlank(enterprisename)) { |
| | | condition.put("enterprisename", enterprisetype.trim()); |
| | | } |
| | | |
| | | if (StringUtils.isNotBlank(starttime)) { |
| | | condition.put("starttime", starttime.trim()); |
| | | } |
| | | |
| | | if (StringUtils.isNotBlank(endttime)) { |
| | | condition.put("endttime", endttime.trim()); |
| | | } |
| | | |
| | | UserInfo userInfo = userService.getById(getUser().getId()); |
| | | if (userInfo.getCompanyid() != null){ |
| | | Enterprise enterprise = enterpriseService.getById(userInfo.getCompanyid()); |
| | | condition.put("enterprisename", enterprise.getEnterprisename()); |
| | | }else if (userInfo.getType() == 3){ |
| | | condition.put("province",userInfo.getProvince()); |
| | | condition.put("city",userInfo.getCity()); |
| | | condition.put("area",userInfo.getArea()); |
| | | condition.put("town",userInfo.getTown()); |
| | | condition.put("community",userInfo.getCommunity()); |
| | | } |
| | | |
| | | if (StringUtils.isNotBlank(province) && condition.get("province") == null) { |
| | | condition.put("province", province.trim()); |
| | | if (StringUtils.isNotBlank(city)) { |
| | | condition.put("city", city.trim()); |
| | | } |
| | | |
| | | if (StringUtils.isNotBlank(area)) { |
| | | condition.put("area", area.trim()); |
| | | } |
| | | |
| | | if (StringUtils.isNotBlank(town)) { |
| | | condition.put("town", town.trim()); |
| | | } |
| | | |
| | | if (StringUtils.isNotBlank(community)){ |
| | | condition.put("community", community.trim()); |
| | | } |
| | | } |
| | | if (ismend != null){ |
| | | condition.put("ismend",ismend); |
| | | } |
| | | condition.put("warntype", "库存超量"); |
| | | pageInfo.setCondition(condition); |
| | | warnContentService.selectStockDataGrid(pageInfo); |
| | | msg.setResult(pageInfo); |
| | | return msg; |
| | | } |
| | | |
| | | @GetMapping("/purchaseWarning") |
| | | @ApiOperation(value = "获取购买超量",response = Msg.class) |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "pageIndex",value = "当前页码"), |
| | | @ApiImplicitParam(name = "pageSize",value = "每页行数"), |
| | | @ApiImplicitParam(name = "sort",value = "排序规则"), |
| | | @ApiImplicitParam(name = "order",value = "排序字段"), |
| | | @ApiImplicitParam(name = "starttime",value = "开始时间"), |
| | | @ApiImplicitParam(name = "endtime",value = "结束时间"), |
| | | @ApiImplicitParam(name = "warnlevel",value = "警告级别"), |
| | | @ApiImplicitParam(name = "customer",value = "购买人"), |
| | | @ApiImplicitParam(name = "idcard",value = "身份证"), |
| | | @ApiImplicitParam(name = "ismend",value = "是否处理"), |
| | | }) |
| | | public Msg getPurchaseWarningList(@RequestParam(defaultValue = "0") Integer pageIndex, @RequestParam(defaultValue = "20") Integer pageSize, String sort, String order, |
| | | String warnlevel, String customer, String idcard, String starttime, String endtime, Byte ismend){ |
| | | Msg msg = new Msg(); |
| | | msg.setCode("200"); |
| | | msg.setMessage("success"); |
| | | |
| | | PageInfo pageInfo = new PageInfo(pageIndex, pageSize,sort,order); |
| | | HashMap<String, Object> condition = new HashMap<String, Object>(); |
| | | |
| | | if (StringUtils.isNotBlank(warnlevel)) { |
| | | condition.put("warnlevel", warnlevel.trim()); |
| | | } |
| | | |
| | | if (StringUtils.isNotBlank(customer)) { |
| | | condition.put("customer", customer.trim()); |
| | | } |
| | | |
| | | if (StringUtils.isNotBlank(idcard)) { |
| | | condition.put("idcard", idcard.trim()); |
| | | } |
| | | |
| | | if (StringUtils.isNotBlank(starttime)) { |
| | | condition.put("starttime", starttime.trim()); |
| | | } |
| | | |
| | | if (StringUtils.isNotBlank(endtime)) { |
| | | condition.put("endtime", endtime.trim()); |
| | | } |
| | | |
| | | if (ismend != null){ |
| | | condition.put("ismend",ismend); |
| | | } |
| | | condition.put("warntype", "购买超量"); |
| | | pageInfo.setCondition(condition); |
| | | warnContentService.selectPurchaseDataGrid(pageInfo); |
| | | msg.setResult(pageInfo); |
| | | return msg; |
| | | } |
| | | |
| | | @GetMapping("/purchaseDetail") |
| | | @ApiOperation(value = "获取购买明细",response = Msg.class) |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "warnid",value = "警告id"), |
| | | }) |
| | | public Msg getPurchaseDetailList(@RequestParam(defaultValue = "0") Integer pageIndex, @RequestParam(defaultValue = "10") Integer pageSize, String sort, String order, |
| | | Long warnid){ |
| | | Msg msg = new Msg(); |
| | | msg.setCode("200"); |
| | | msg.setMessage("success"); |
| | | PageInfo pageInfo = new PageInfo(pageIndex, pageSize,sort,order); |
| | | |
| | | WarnContentInfo warningContentInfo = warnContentService.getById(warnid); |
| | | if (warningContentInfo != null && warningContentInfo.getCustomid() != null){ |
| | | //分页 datagrid content添加周期 开始结束时间 |
| | | HashMap<String, Object> condition = new HashMap<String, Object>(); |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | Date endtime = warningContentInfo.getCreateddate(); |
| | | Integer period = warningContentInfo.getPeriod(); |
| | | Calendar calendar = Calendar.getInstance(); |
| | | calendar.setTime(endtime); |
| | | calendar.add(Calendar.DATE,-period); |
| | | String starttime = sdf.format(calendar.getTime()); |
| | | condition.put("starttime", starttime); |
| | | condition.put("endtime", sdf.format(warningContentInfo.getCreateddate())); |
| | | condition.put("customid", warningContentInfo.getCustomid()); |
| | | pageInfo.setCondition(condition); |
| | | saleOrderDetailService.selectByCustomId(pageInfo); |
| | | } |
| | | msg.setResult(pageInfo); |
| | | return msg; |
| | | } |
| | | |
| | | @GetMapping("/alarmList") |
| | | @ApiOperation(value = "获取报警未处理的列表",response = Msg.class) |
| | | public Msg getAlarmList(){ |
| | | Msg msg = new Msg(); |
| | | msg.setCode("200"); |
| | | msg.setMessage("success"); |
| | | List<WarnContentVo> warningContentInfos = warnContentService.selectIsNotMend(); |
| | | msg.setResult(warningContentInfos); |
| | | return msg; |
| | | } |
| | | |
| | | @GetMapping("/warningList") |
| | | @ApiOperation(value = "获取报警预警列表",response = Msg.class) |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "pageIndex",value = "当前页码"), |
| | | @ApiImplicitParam(name = "pageSize",value = "每页行数"), |
| | | @ApiImplicitParam(name = "sort",value = "排序规则"), |
| | | @ApiImplicitParam(name = "order",value = "排序字段"), |
| | | @ApiImplicitParam(name = "warnlevel",value = "警告级别"), |
| | | @ApiImplicitParam(name = "enterprisetype",value = "企业类型"), |
| | | @ApiImplicitParam(name = "enterprisename",value = "企业名称"), |
| | | @ApiImplicitParam(name = "starttime",value = "开始时间"), |
| | | @ApiImplicitParam(name = "endtime",value = "结束时间"), |
| | | @ApiImplicitParam(name = "customer",value = "购买人"), |
| | | @ApiImplicitParam(name = "idcard",value = "身份证"), |
| | | @ApiImplicitParam(name = "ismend",value = "是否处理"), |
| | | }) |
| | | public Msg getWarningList(@RequestParam(defaultValue = "0") Integer pageIndex, @RequestParam(defaultValue = "20") Integer pageSize, String sort, String order, |
| | | String warnlevel, String enterprisetype, String enterprisename, String starttime, String endttime, Byte ismend, String customer, String idcard |
| | | ){ |
| | | Msg msg = new Msg(); |
| | | msg.setCode("200"); |
| | | msg.setMessage("success"); |
| | | |
| | | PageInfo pageInfo = new PageInfo(pageIndex, pageSize,sort,order); |
| | | HashMap<String, Object> condition = new HashMap<String, Object>(); |
| | | |
| | | if (StringUtils.isNotBlank(warnlevel)) { |
| | | condition.put("warnlevel", warnlevel.trim()); |
| | | } |
| | | |
| | | if (StringUtils.isNotBlank(enterprisetype)) { |
| | | condition.put("enterprisetype", enterprisetype.trim()); |
| | | } |
| | | |
| | | if (StringUtils.isNotBlank(enterprisename)) { |
| | | condition.put("enterprisename", enterprisetype.trim()); |
| | | } |
| | | |
| | | if (StringUtils.isNotBlank(starttime)) { |
| | | condition.put("starttime", starttime.trim()); |
| | | } |
| | | |
| | | if (StringUtils.isNotBlank(endttime)) { |
| | | condition.put("endttime", endttime.trim()); |
| | | } |
| | | |
| | | if (ismend != null){ |
| | | condition.put("ismend",ismend); |
| | | } |
| | | |
| | | if (StringUtils.isNotBlank(customer)) { |
| | | condition.put("customer", customer.trim()); |
| | | } |
| | | |
| | | if (StringUtils.isNotBlank(idcard)) { |
| | | condition.put("idcard", idcard.trim()); |
| | | } |
| | | |
| | | pageInfo.setCondition(condition); |
| | | warnContentService.selectWarningDataGrid(pageInfo); |
| | | return msg; |
| | | } |
| | | |
| | | @PostMapping("/mendAlarm") |
| | | @ApiOperation(value = "处理报警信息",response = Msg.class) |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "id",value = "报警id"), |
| | | }) |
| | | public Msg mendAlarm(@RequestBody JSONObject jsonObject){ |
| | | Msg msg = new Msg(); |
| | | msg.setCode("200"); |
| | | msg.setMessage("success"); |
| | | Long id = jsonObject.getLong("id"); |
| | | WarnContentInfo warningContentInfo = warnContentService.getById(id); |
| | | if (warningContentInfo != null){ |
| | | warningContentInfo.setIsmend((byte)1); |
| | | warnContentService.updateById(warningContentInfo); |
| | | } |
| | | return msg; |
| | | } |
| | | |
| | | @GetMapping("/entryWarning") |
| | | @ApiOperation(value = "获取超期未入库",response = Msg.class) |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "pageIndex",value = "当前页码"), |
| | | @ApiImplicitParam(name = "pageSize",value = "每页行数"), |
| | | @ApiImplicitParam(name = "sort",value = "排序规则"), |
| | | @ApiImplicitParam(name = "order",value = "排序字段"), |
| | | @ApiImplicitParam(name = "warnlevel",value = "警告级别"), |
| | | @ApiImplicitParam(name = "enterprisetype",value = "企业类型"), |
| | | @ApiImplicitParam(name = "enterprisename",value = "企业名称"), |
| | | @ApiImplicitParam(name = "starttime",value = "开始时间"), |
| | | @ApiImplicitParam(name = "endtime",value = "结束时间"), |
| | | @ApiImplicitParam(name = "province",value = "省份"), |
| | | @ApiImplicitParam(name = "city",value = "城市"), |
| | | @ApiImplicitParam(name = "area",value = "区县"), |
| | | @ApiImplicitParam(name = "town",value = "乡镇"), |
| | | @ApiImplicitParam(name = "community",value = "社区"), |
| | | @ApiImplicitParam(name = "ismend",value = "是否处理"), |
| | | }) |
| | | public Msg getEntryWarningList(@RequestParam(defaultValue = "0") Integer pageIndex, @RequestParam(defaultValue = "20") Integer pageSize, String sort, String order, |
| | | String warnlevel, String enterprisetype, String enterprisename, String starttime, String endttime, |
| | | String province, String city, String area, String town, String community, Byte ismend){ |
| | | Msg msg = new Msg(); |
| | | msg.setCode("200"); |
| | | msg.setMessage("success"); |
| | | PageInfo pageInfo = new PageInfo(pageIndex, pageSize,sort,order); |
| | | HashMap<String, Object> condition = new HashMap<String, Object>(); |
| | | |
| | | if (StringUtils.isNotBlank(warnlevel)) { |
| | | condition.put("warnlevel", warnlevel.trim()); |
| | | } |
| | | if (StringUtils.isNotBlank(enterprisetype)) { |
| | | condition.put("enterprisetype", enterprisetype.trim()); |
| | | } |
| | | if (StringUtils.isNotBlank(enterprisename)) { |
| | | condition.put("enterprisename", enterprisetype.trim()); |
| | | } |
| | | if (StringUtils.isNotBlank(starttime)) { |
| | | condition.put("starttime", starttime.trim()); |
| | | } |
| | | if (StringUtils.isNotBlank(endttime)) { |
| | | condition.put("endttime", endttime.trim()); |
| | | } |
| | | |
| | | UserInfo userInfo = userService.getById(getUser().getId()); |
| | | if (userInfo.getCompanyid() != null){ |
| | | Enterprise enterprise = enterpriseService.getById(userInfo.getCompanyid()); |
| | | condition.put("enterprisename", enterprise.getEnterprisename()); |
| | | }else if (userInfo.getType() == 3){ |
| | | condition.put("province",userInfo.getProvince()); |
| | | condition.put("city",userInfo.getCity()); |
| | | condition.put("area",userInfo.getArea()); |
| | | condition.put("town",userInfo.getTown()); |
| | | condition.put("community",userInfo.getCommunity()); |
| | | } |
| | | |
| | | if (StringUtils.isNotBlank(province) && condition.get("province") == null) { |
| | | condition.put("province", province.trim()); |
| | | if (StringUtils.isNotBlank(city)) { |
| | | condition.put("city", city.trim()); |
| | | } |
| | | if (StringUtils.isNotBlank(area)) { |
| | | condition.put("area", area.trim()); |
| | | } |
| | | if (StringUtils.isNotBlank(town)) { |
| | | condition.put("town", town.trim()); |
| | | } |
| | | if (StringUtils.isNotBlank(community)){ |
| | | condition.put("community", community.trim()); |
| | | } |
| | | } |
| | | if (ismend != null){ |
| | | condition.put("ismend",ismend); |
| | | } |
| | | condition.put("warntype", WARN_TYPE_ENTRY); |
| | | pageInfo.setCondition(condition); |
| | | warnContentService.selectStockDataGrid(pageInfo); |
| | | msg.setResult(pageInfo); |
| | | return msg; |
| | | } |
| | | |
| | | @GetMapping("/entryDetail") |
| | | @ApiOperation(value = "获取超期未入库明细",response = Msg.class) |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "warnid",value = "警告id"), |
| | | }) |
| | | public Msg getEntryDetailList(@RequestParam(defaultValue = "0") Integer pageIndex, @RequestParam(defaultValue = "10") Integer pageSize, String sort, String order, |
| | | Long warnid){ |
| | | Msg msg = new Msg(); |
| | | msg.setCode("200"); |
| | | msg.setMessage("success"); |
| | | PageInfo pageInfo = new PageInfo(pageIndex, pageSize,sort,order); |
| | | |
| | | WarnContentInfo warningContentInfo = warnContentService.getById(warnid); |
| | | if (warningContentInfo != null){ |
| | | //分页 datagrid content添加周期 开始结束时间 |
| | | HashMap<String, Object> condition = new HashMap<String, Object>(); |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | Date endtime = warningContentInfo.getCreateddate(); |
| | | Integer period = warningContentInfo.getPeriod(); |
| | | Calendar calendar = Calendar.getInstance(); |
| | | calendar.setTime(endtime); |
| | | calendar.add(Calendar.DATE,-period); |
| | | String starttime = sdf.format(calendar.getTime()); |
| | | condition.put("enterpriseid",warningContentInfo.getEnterpriseid()); |
| | | condition.put("starttime", starttime); |
| | | pageInfo.setCondition(condition); |
| | | stockService.selectNoEntryDetail(pageInfo); |
| | | } |
| | | msg.setResult(pageInfo); |
| | | return msg; |
| | | } |
| | | |
| | | @GetMapping("/certWarning") |
| | | @ApiOperation(value = "获取运输证超期",response = Msg.class) |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "pageIndex",value = "当前页码"), |
| | | @ApiImplicitParam(name = "pageSize",value = "每页行数"), |
| | | @ApiImplicitParam(name = "sort",value = "排序规则"), |
| | | @ApiImplicitParam(name = "order",value = "排序字段"), |
| | | @ApiImplicitParam(name = "warnlevel",value = "警告级别"), |
| | | @ApiImplicitParam(name = "enterprisetype",value = "企业类型"), |
| | | @ApiImplicitParam(name = "enterprisename",value = "企业名称"), |
| | | @ApiImplicitParam(name = "starttime",value = "开始时间"), |
| | | @ApiImplicitParam(name = "endtime",value = "结束时间"), |
| | | @ApiImplicitParam(name = "province",value = "省份"), |
| | | @ApiImplicitParam(name = "city",value = "城市"), |
| | | @ApiImplicitParam(name = "area",value = "区县"), |
| | | @ApiImplicitParam(name = "town",value = "乡镇"), |
| | | @ApiImplicitParam(name = "community",value = "社区"), |
| | | @ApiImplicitParam(name = "ismend",value = "是否处理"), |
| | | }) |
| | | public Msg getCertWarningList(@RequestParam(defaultValue = "0") Integer pageIndex, @RequestParam(defaultValue = "20") Integer pageSize, String sort, String order, |
| | | String warnlevel, String enterprisetype, String enterprisename, String starttime, String endttime, |
| | | String province, String city, String area, String town, String community, Byte ismend){ |
| | | Msg msg = new Msg(); |
| | | msg.setCode("200"); |
| | | msg.setMessage("success"); |
| | | |
| | | PageInfo pageInfo = new PageInfo(pageIndex, pageSize,sort,order); |
| | | HashMap<String, Object> condition = new HashMap<String, Object>(); |
| | | |
| | | if (StringUtils.isNotBlank(warnlevel)) { |
| | | condition.put("warnlevel", warnlevel.trim()); |
| | | } |
| | | |
| | | if (StringUtils.isNotBlank(enterprisetype)) { |
| | | condition.put("enterprisetype", enterprisetype.trim()); |
| | | } |
| | | |
| | | if (StringUtils.isNotBlank(enterprisename)) { |
| | | condition.put("enterprisename", enterprisetype.trim()); |
| | | } |
| | | |
| | | if (StringUtils.isNotBlank(starttime)) { |
| | | condition.put("starttime", starttime.trim()); |
| | | } |
| | | |
| | | if (StringUtils.isNotBlank(endttime)) { |
| | | condition.put("endttime", endttime.trim()); |
| | | } |
| | | |
| | | UserInfo userInfo = userService.getById(getUser().getId()); |
| | | if (userInfo.getCompanyid() != null){ |
| | | Enterprise enterprise = enterpriseService.getById(userInfo.getCompanyid()); |
| | | condition.put("enterprisename", enterprise.getEnterprisename()); |
| | | }else if (userInfo.getType() == 3){ |
| | | condition.put("province",userInfo.getProvince()); |
| | | condition.put("city",userInfo.getCity()); |
| | | condition.put("area",userInfo.getArea()); |
| | | condition.put("town",userInfo.getTown()); |
| | | condition.put("community",userInfo.getCommunity()); |
| | | } |
| | | |
| | | if (StringUtils.isNotBlank(province) && condition.get("province") == null) { |
| | | condition.put("province", province.trim()); |
| | | if (StringUtils.isNotBlank(city)) { |
| | | condition.put("city", city.trim()); |
| | | } |
| | | |
| | | if (StringUtils.isNotBlank(area)) { |
| | | condition.put("area", area.trim()); |
| | | } |
| | | |
| | | if (StringUtils.isNotBlank(town)) { |
| | | condition.put("town", town.trim()); |
| | | } |
| | | |
| | | if (StringUtils.isNotBlank(community)){ |
| | | condition.put("community", community.trim()); |
| | | } |
| | | } |
| | | if (ismend != null){ |
| | | condition.put("ismend",ismend); |
| | | } |
| | | condition.put("warntype", WARN_TYPE_CERT); |
| | | pageInfo.setCondition(condition); |
| | | warnContentService.selectStockDataGrid(pageInfo); |
| | | msg.setResult(pageInfo); |
| | | return msg; |
| | | } |
| | | } |