24 changed files with 2195 additions and 6 deletions
@ -0,0 +1,135 @@ |
|||||
|
package com.zdxt.app.controller; |
||||
|
|
||||
|
import com.zdxt.code.domain.EnforcementInspectionProgram; |
||||
|
import com.zdxt.code.service.IEnforcementInspectionProgramService; |
||||
|
import com.zdxt.common.ZDResponse; |
||||
|
import com.zdxt.common.controller.BaseController; |
||||
|
import com.zdxt.common.util.TableDataInfo; |
||||
|
import org.apache.shiro.authz.annotation.RequiresPermissions; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.stereotype.Controller; |
||||
|
import org.springframework.ui.ModelMap; |
||||
|
import org.springframework.web.bind.annotation.*; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* 执法检查计划Controller |
||||
|
* |
||||
|
* @author chenrui |
||||
|
* @date 2024-03-12 |
||||
|
*/ |
||||
|
@Controller |
||||
|
@RequestMapping("/app/code/enforcementInspectionProgram") |
||||
|
public class AppEnforcementInspectionProgramController extends BaseController |
||||
|
{ |
||||
|
private String prefix = "code/enforcementInspectionProgram"; |
||||
|
|
||||
|
@Autowired |
||||
|
private IEnforcementInspectionProgramService enforcementInspectionProgramService; |
||||
|
|
||||
|
@RequiresPermissions("code:enforcementInspectionProgram:view") |
||||
|
@GetMapping() |
||||
|
public String enforcementInspectionProgram() |
||||
|
{ |
||||
|
return prefix + "/enforcementInspectionProgram"; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 查询执法检查计划列表 |
||||
|
*/ |
||||
|
// @RequiresPermissions("code:enforcementInspectionProgram:list")
|
||||
|
@PostMapping("/list") |
||||
|
@ResponseBody |
||||
|
public TableDataInfo list(EnforcementInspectionProgram enforcementInspectionProgram) |
||||
|
{ |
||||
|
startPage(); |
||||
|
List<EnforcementInspectionProgram> list = enforcementInspectionProgramService.selectEnforcementInspectionProgramList(enforcementInspectionProgram); |
||||
|
return getDataTable(list); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 查询执法检查计划列表 |
||||
|
*/ |
||||
|
// @RequiresPermissions("code:enforcementInspectionProgram:queryList")
|
||||
|
@GetMapping("/queryList") |
||||
|
@ResponseBody |
||||
|
public ZDResponse queryList(EnforcementInspectionProgram enforcementInspectionProgram) |
||||
|
{ |
||||
|
startPage(); |
||||
|
List<EnforcementInspectionProgram> list = enforcementInspectionProgramService.selectEnforcementInspectionProgramList(enforcementInspectionProgram); |
||||
|
return ZDResponse.success("查询成功",list); |
||||
|
} |
||||
|
/** |
||||
|
* 查询执法检查计划列表 |
||||
|
*/ |
||||
|
// @RequiresPermissions("code:enforcementInspectionProgram:queryList")
|
||||
|
@GetMapping("/queryListNoPermission") |
||||
|
@ResponseBody |
||||
|
public ZDResponse queryListNoPermission(EnforcementInspectionProgram enforcementInspectionProgram) |
||||
|
{ |
||||
|
startPage(); |
||||
|
List<EnforcementInspectionProgram> list = |
||||
|
enforcementInspectionProgramService.selectEnforcementInspectionProgramListNoPermission(enforcementInspectionProgram); |
||||
|
return ZDResponse.success("查询成功",list); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 新增执法检查计划 |
||||
|
*/ |
||||
|
@GetMapping("/add") |
||||
|
public String add() |
||||
|
{ |
||||
|
return prefix + "/add"; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 新增保存执法检查计划 |
||||
|
*/ |
||||
|
// @RequiresPermissions("code:enforcementInspectionProgram:add")
|
||||
|
@PostMapping("/add") |
||||
|
@ResponseBody |
||||
|
public ZDResponse addSave(@RequestBody EnforcementInspectionProgram enforcementInspectionProgram) |
||||
|
{ |
||||
|
return enforcementInspectionProgramService.insertEnforcementInspectionProgram(enforcementInspectionProgram) > 0 ? |
||||
|
ZDResponse.success("保存成功"):ZDResponse.error("保存失败"); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 修改执法检查计划 |
||||
|
*/ |
||||
|
@GetMapping("/edit/{id}") |
||||
|
public String edit(@PathVariable("id") String id, ModelMap mmap) |
||||
|
{ |
||||
|
EnforcementInspectionProgram enforcementInspectionProgram = enforcementInspectionProgramService.selectEnforcementInspectionProgramById(id); |
||||
|
mmap.put("enforcementInspectionProgram", enforcementInspectionProgram); |
||||
|
return prefix + "/edit"; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 修改保存执法检查计划 |
||||
|
*/ |
||||
|
@RequiresPermissions("code:enforcementInspectionProgram:edit") |
||||
|
@PostMapping("/edit") |
||||
|
@ResponseBody |
||||
|
public ZDResponse editSave(EnforcementInspectionProgram enforcementInspectionProgram) |
||||
|
{ |
||||
|
return enforcementInspectionProgramService. |
||||
|
updateEnforcementInspectionProgram(enforcementInspectionProgram) > 0 ? |
||||
|
ZDResponse.success("修改成功") : ZDResponse.error("修改失败"); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 删除执法检查计划 |
||||
|
*/ |
||||
|
@RequiresPermissions("code:enforcementInspectionProgram:remove") |
||||
|
@PostMapping( "/remove") |
||||
|
@ResponseBody |
||||
|
public ZDResponse remove(String ids) |
||||
|
{ |
||||
|
return enforcementInspectionProgramService.deleteEnforcementInspectionProgramByIds(ids) > 0 ? |
||||
|
ZDResponse.success("删除成功") : ZDResponse.error("删除失败"); |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,241 @@ |
|||||
|
package com.zdxt.app.controller; |
||||
|
|
||||
|
import com.zdxt.code.domain.EnforceRegCount; |
||||
|
import com.zdxt.code.domain.EnforcementRegistration; |
||||
|
import com.zdxt.code.domain.LinkageDict; |
||||
|
import com.zdxt.code.service.IEnforcementRegistrationService; |
||||
|
import com.zdxt.code.service.ILinkageDictService; |
||||
|
import com.zdxt.common.ZDResponse; |
||||
|
import com.zdxt.common.controller.BaseController; |
||||
|
import com.zdxt.common.util.StringUtils; |
||||
|
import com.zdxt.common.util.TableDataInfo; |
||||
|
import org.apache.shiro.authz.annotation.RequiresPermissions; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.stereotype.Controller; |
||||
|
import org.springframework.ui.ModelMap; |
||||
|
import org.springframework.web.bind.annotation.*; |
||||
|
|
||||
|
import java.util.HashMap; |
||||
|
import java.util.List; |
||||
|
import java.util.Map; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 执法端-执法登记Controller |
||||
|
* |
||||
|
* @author chenrui |
||||
|
* @date 2024-02-23 |
||||
|
*/ |
||||
|
@Controller |
||||
|
@RequestMapping("/app/code/registration") |
||||
|
public class AppEnforcementRegistrationController extends BaseController |
||||
|
{ |
||||
|
private String prefix = "project/code/registration"; |
||||
|
|
||||
|
@Autowired |
||||
|
private IEnforcementRegistrationService enforcementRegistrationService; |
||||
|
@Autowired private ILinkageDictService iLinkageDictService; |
||||
|
|
||||
|
@RequiresPermissions("code:registration:view") |
||||
|
@GetMapping() |
||||
|
public String registration() |
||||
|
{ |
||||
|
return prefix + "/registration"; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 查询执法端-执法登记列表 |
||||
|
*/ |
||||
|
@RequiresPermissions("code:registration:list") |
||||
|
@PostMapping("/list") |
||||
|
@ResponseBody |
||||
|
public TableDataInfo list(EnforcementRegistration enforcementRegistration) |
||||
|
{ |
||||
|
startPage(); |
||||
|
List<EnforcementRegistration> list = enforcementRegistrationService.selectEnforcementRegistrationList(enforcementRegistration); |
||||
|
return getDataTable(list); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 查询执法端-执法登记列表 |
||||
|
*/ |
||||
|
@RequiresPermissions("code:registration:list") |
||||
|
@GetMapping("/queryList") |
||||
|
@ResponseBody |
||||
|
public ZDResponse queryList(EnforcementRegistration enforcementRegistration) |
||||
|
{ |
||||
|
List<EnforcementRegistration> list = enforcementRegistrationService.selectEnforcementRegistrationList(enforcementRegistration); |
||||
|
return ZDResponse.success("查询成功",list); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 新增执法端-执法登记 |
||||
|
*/ |
||||
|
@GetMapping("/add") |
||||
|
public String add() |
||||
|
{ |
||||
|
return prefix + "/add"; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 新增保存执法端-执法登记 |
||||
|
*/ |
||||
|
@RequiresPermissions("code:registration:add") |
||||
|
@PostMapping("/add") |
||||
|
@ResponseBody |
||||
|
public ZDResponse addSave(@RequestBody EnforcementRegistration enforcementRegistration) |
||||
|
{ |
||||
|
return enforcementRegistrationService.insertEnforcementRegistration(enforcementRegistration) > 0 |
||||
|
? ZDResponse.success("保存成功") : ZDResponse.error("保存失败"); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 修改执法端-执法登记 |
||||
|
*/ |
||||
|
@GetMapping("/edit/{id}") |
||||
|
public String edit(@PathVariable("id") String id, ModelMap mmap) |
||||
|
{ |
||||
|
EnforcementRegistration enforcementRegistration = enforcementRegistrationService.selectEnforcementRegistrationById(id); |
||||
|
mmap.put("enforcementRegistration", enforcementRegistration); |
||||
|
return prefix + "/edit"; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 修改保存执法端-执法登记 |
||||
|
*/ |
||||
|
@RequiresPermissions("code:registration:edit") |
||||
|
@PostMapping("/edit") |
||||
|
@ResponseBody |
||||
|
public ZDResponse editSave(@RequestBody EnforcementRegistration enforcementRegistration) |
||||
|
{ |
||||
|
int resNum = 0; |
||||
|
enforcementRegistration.setIsSubmit(1); |
||||
|
if (StringUtils.isNotEmpty(enforcementRegistration.getId())) { |
||||
|
resNum = enforcementRegistrationService.updateEnforcementRegistration(enforcementRegistration); |
||||
|
} else { |
||||
|
resNum = enforcementRegistrationService.insertEnforcementRegistration(enforcementRegistration); |
||||
|
} |
||||
|
return resNum > 0 ? ZDResponse.success("修改成功") : ZDResponse.error("修改失败"); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 修改执法端-执法登记 |
||||
|
*/ |
||||
|
@GetMapping("/detail/{id}") |
||||
|
public String detail(@PathVariable("id") String id, ModelMap mmap) |
||||
|
{ |
||||
|
EnforcementRegistration enforcementRegistration = enforcementRegistrationService.selectEnforcementRegistrationById(id); |
||||
|
mmap.put("enforcementRegistration", enforcementRegistration); |
||||
|
return prefix + "/detail"; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 修改保存执法端-执法登记提交 |
||||
|
*/ |
||||
|
@RequiresPermissions("code:registration:submit") |
||||
|
@PostMapping("/submit") |
||||
|
@ResponseBody |
||||
|
public ZDResponse submit(@RequestBody EnforcementRegistration enforcementRegistration) |
||||
|
{ |
||||
|
return enforcementRegistrationService.updateEnforcementRegistration(enforcementRegistration) > 0 ? |
||||
|
ZDResponse.success("提交成功") : ZDResponse.error("提交失败"); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 删除执法端-执法登记 |
||||
|
*/ |
||||
|
@RequiresPermissions("code:registration:remove") |
||||
|
@PostMapping( "/remove") |
||||
|
@ResponseBody |
||||
|
public ZDResponse remove(String ids) |
||||
|
{ |
||||
|
return enforcementRegistrationService.deleteEnforcementRegistrationByIds(ids) > 0 ? |
||||
|
ZDResponse.success("删除成功") : ZDResponse.error("删除失败"); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 获取预警信息 |
||||
|
*/ |
||||
|
@RequiresPermissions("code:registration:list") |
||||
|
@GetMapping("/queryEarlyWarning") |
||||
|
@ResponseBody |
||||
|
public ZDResponse queryEarlyWarning(EnforcementRegistration enforcementRegistration) |
||||
|
{ |
||||
|
List<EnforceRegCount> list = enforcementRegistrationService.queryEarlyWarning(enforcementRegistration.getSearchValue()); |
||||
|
return ZDResponse.success("查询成功",list); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 执法登记详情 |
||||
|
*/ |
||||
|
@GetMapping("/queryById/{id}") |
||||
|
@ResponseBody |
||||
|
public ZDResponse queryById(@PathVariable("id") String id) |
||||
|
{ |
||||
|
EnforcementRegistration enforcementRegistration = enforcementRegistrationService.selectEnforcementRegistrationById(id); |
||||
|
return ZDResponse.success("查询成功",enforcementRegistration); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 查询附件信息 |
||||
|
* |
||||
|
* @param key |
||||
|
* @return |
||||
|
*/ |
||||
|
@GetMapping("/queryFiles/{key}") |
||||
|
@ResponseBody |
||||
|
public ZDResponse queryFiles(@PathVariable String key) { |
||||
|
HashMap<String, Object> map = new HashMap<>(); |
||||
|
map.put("filePreview", enforcementRegistrationService.queryFiles(key)); |
||||
|
return ZDResponse.success("获取成功", map); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 查询附件信息 |
||||
|
* |
||||
|
* @param key |
||||
|
* @return |
||||
|
*/ |
||||
|
@PostMapping("/queryFilesPost") |
||||
|
@ResponseBody |
||||
|
public ZDResponse queryFilesPost(String key) { |
||||
|
HashMap<String, Object> map = new HashMap<>(); |
||||
|
map.put("filePreview", enforcementRegistrationService.queryFiles(key)); |
||||
|
return ZDResponse.success("获取成功", map); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 查看预约记录详情 |
||||
|
*/ |
||||
|
@GetMapping( "/getByUserIdAndZero") |
||||
|
@ResponseBody |
||||
|
public ZDResponse getByUserIdAndZero() |
||||
|
{ |
||||
|
EnforcementRegistration registration = enforcementRegistrationService.getByUserIdAndZero(); |
||||
|
Map<String, Object> params = new HashMap<>(); |
||||
|
LinkageDict tmp = iLinkageDictService.selectLinkageDictById(registration.getLawEnforcementItem()); |
||||
|
params.put("lawEnforcementItemText", tmp.getTitle()); |
||||
|
tmp = iLinkageDictService.selectLinkageDictById(registration.getLawEnforcementBasis()); |
||||
|
params.put("lawEnforcementBasisText", tmp.getTitle()); |
||||
|
registration.setParams(params); |
||||
|
return ZDResponse.success("查询成功", registration); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 查看预约记录详情 |
||||
|
*/ |
||||
|
@GetMapping( "/getByIdToDataFillIn/{id}") |
||||
|
@ResponseBody |
||||
|
public ZDResponse getByIdToDataFillIn(@PathVariable String id) |
||||
|
{ |
||||
|
EnforcementRegistration registration = enforcementRegistrationService.getEnforcementRegistrationById(id); |
||||
|
Map<String, Object> params = new HashMap<>(); |
||||
|
LinkageDict tmp = iLinkageDictService.selectLinkageDictById(registration.getLawEnforcementItem()); |
||||
|
params.put("lawEnforcementItemText", tmp.getTitle()); |
||||
|
tmp = iLinkageDictService.selectLinkageDictById(registration.getLawEnforcementBasis()); |
||||
|
params.put("lawEnforcementBasisText", tmp.getTitle()); |
||||
|
registration.setParams(params); |
||||
|
return ZDResponse.success("查询成功", registration); |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,106 @@ |
|||||
|
package com.zdxt.app.controller; |
||||
|
|
||||
|
import com.zdxt.code.domain.EnterpriseComplaint; |
||||
|
import com.zdxt.code.service.IEnterpriseComplaintService; |
||||
|
import com.zdxt.common.ZDResponse; |
||||
|
import com.zdxt.common.controller.BaseController; |
||||
|
import com.zdxt.common.util.TableDataInfo; |
||||
|
import org.apache.shiro.authz.annotation.RequiresPermissions; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.stereotype.Controller; |
||||
|
import org.springframework.ui.ModelMap; |
||||
|
import org.springframework.web.bind.annotation.*; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* 企业执法-在线投诉Controller |
||||
|
* |
||||
|
* @author chenrui |
||||
|
* @date 2024-02-23 |
||||
|
*/ |
||||
|
@Controller |
||||
|
@RequestMapping("/app/code/complaint") |
||||
|
public class AppEnterpriseComplaintController extends BaseController |
||||
|
{ |
||||
|
private String prefix = "code/complaint"; |
||||
|
|
||||
|
@Autowired |
||||
|
private IEnterpriseComplaintService enterpriseComplaintService; |
||||
|
|
||||
|
@RequiresPermissions("code:complaint:view") |
||||
|
@GetMapping() |
||||
|
public String complaint() |
||||
|
{ |
||||
|
return prefix + "/complaint"; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 查询企业执法-在线投诉列表 |
||||
|
*/ |
||||
|
@RequiresPermissions("code:complaint:list") |
||||
|
@PostMapping("/list") |
||||
|
@ResponseBody |
||||
|
public TableDataInfo list(EnterpriseComplaint enterpriseComplaint) |
||||
|
{ |
||||
|
startPage(); |
||||
|
List<EnterpriseComplaint> list = enterpriseComplaintService.selectEnterpriseComplaintList(enterpriseComplaint); |
||||
|
return getDataTable(list); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 新增企业执法-在线投诉 |
||||
|
*/ |
||||
|
@GetMapping("/add") |
||||
|
public String add() |
||||
|
{ |
||||
|
return prefix + "/add"; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 新增保存企业执法-在线投诉 |
||||
|
*/ |
||||
|
@RequiresPermissions("code:complaint:add") |
||||
|
@PostMapping("/add") |
||||
|
@ResponseBody |
||||
|
public ZDResponse addSave(@RequestBody EnterpriseComplaint enterpriseComplaint) |
||||
|
{ |
||||
|
return enterpriseComplaintService.insertEnterpriseComplaint(enterpriseComplaint) > 0 ? |
||||
|
ZDResponse.success("保存成功") : ZDResponse.error("保存失败"); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 修改企业执法-在线投诉 |
||||
|
*/ |
||||
|
@GetMapping("/edit/{id}") |
||||
|
public String edit(@PathVariable("id") String id, ModelMap mmap) |
||||
|
{ |
||||
|
EnterpriseComplaint enterpriseComplaint = enterpriseComplaintService.selectEnterpriseComplaintById(id); |
||||
|
mmap.put("enterpriseComplaint", enterpriseComplaint); |
||||
|
return prefix + "/edit"; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 修改保存企业执法-在线投诉 |
||||
|
*/ |
||||
|
@RequiresPermissions("code:complaint:edit") |
||||
|
@PostMapping("/edit") |
||||
|
@ResponseBody |
||||
|
public ZDResponse editSave(EnterpriseComplaint enterpriseComplaint) |
||||
|
{ |
||||
|
return enterpriseComplaintService.updateEnterpriseComplaint(enterpriseComplaint) > 0 ? |
||||
|
ZDResponse.success("修改成功") : ZDResponse.error("修改失败"); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 删除企业执法-在线投诉 |
||||
|
*/ |
||||
|
@RequiresPermissions("code:complaint:remove") |
||||
|
@PostMapping( "/remove") |
||||
|
@ResponseBody |
||||
|
public ZDResponse remove(String ids) |
||||
|
{ |
||||
|
return enterpriseComplaintService.deleteEnterpriseComplaintByIds(ids) > 0 |
||||
|
? ZDResponse.success("删除成功") : ZDResponse.error("删除失败"); |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,202 @@ |
|||||
|
package com.zdxt.app.controller; |
||||
|
|
||||
|
import com.zdxt.code.domain.EnterpriseInformation; |
||||
|
import com.zdxt.code.domain.QrCodeGenerateHistory; |
||||
|
import com.zdxt.code.service.IEnterpriseInformationService; |
||||
|
import com.zdxt.code.service.IQrCodeGenerateHistoryService; |
||||
|
import com.zdxt.common.ZDResponse; |
||||
|
import com.zdxt.common.controller.BaseController; |
||||
|
import com.zdxt.common.util.TableDataInfo; |
||||
|
import org.apache.shiro.authz.annotation.RequiresPermissions; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.stereotype.Controller; |
||||
|
import org.springframework.ui.ModelMap; |
||||
|
import org.springframework.web.bind.annotation.*; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* 企业信息登记Controller |
||||
|
* |
||||
|
* @author chenrui |
||||
|
* @date 2024-02-20 |
||||
|
*/ |
||||
|
@Controller |
||||
|
@RequestMapping("/app/enterpriseInformation") |
||||
|
public class AppEnterpriseInformationController extends BaseController |
||||
|
{ |
||||
|
private String prefix = "project/code/information"; |
||||
|
|
||||
|
@Autowired |
||||
|
private IEnterpriseInformationService enterpriseInformationService; |
||||
|
|
||||
|
@Autowired |
||||
|
private IQrCodeGenerateHistoryService iQrCodeGenerateHistoryService; |
||||
|
|
||||
|
@RequiresPermissions("code:information:view") |
||||
|
@GetMapping() |
||||
|
public String information() |
||||
|
{ |
||||
|
return prefix + "/information"; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 查询企业信息登记列表 |
||||
|
*/ |
||||
|
@RequiresPermissions("code:information:list") |
||||
|
@PostMapping("/list") |
||||
|
@ResponseBody |
||||
|
public TableDataInfo list(EnterpriseInformation enterpriseInformation) |
||||
|
{ |
||||
|
startPage(); |
||||
|
List<EnterpriseInformation> list = enterpriseInformationService.selectEnterpriseInformationList(enterpriseInformation); |
||||
|
return getDataTable(list); |
||||
|
} |
||||
|
/** |
||||
|
* 查询企业信息登记列表 |
||||
|
*/ |
||||
|
@GetMapping("/queryList") |
||||
|
@ResponseBody |
||||
|
public ZDResponse queryList(EnterpriseInformation enterpriseInformation) |
||||
|
{ |
||||
|
startPage(); |
||||
|
List<EnterpriseInformation> list = enterpriseInformationService.selectEnterpriseInformationList(enterpriseInformation); |
||||
|
return ZDResponse.success("查询成功",list); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 新增企业信息登记 |
||||
|
*/ |
||||
|
@GetMapping("/add") |
||||
|
public String add() |
||||
|
{ |
||||
|
return prefix + "/add"; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 新增保存企业信息登记 |
||||
|
*/ |
||||
|
@RequiresPermissions("code:information:add") |
||||
|
@PostMapping("/add") |
||||
|
@ResponseBody |
||||
|
public ZDResponse addSave(@RequestBody EnterpriseInformation enterpriseInformation) |
||||
|
{ |
||||
|
return enterpriseInformationService.insertEnterpriseInformation(enterpriseInformation) > 0 |
||||
|
? ZDResponse.success("登记成功"): ZDResponse.error("登记失败"); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 修改企业信息登记 |
||||
|
*/ |
||||
|
@GetMapping("/edit/{id}") |
||||
|
public String edit(@PathVariable("id") String id, ModelMap mmap) |
||||
|
{ |
||||
|
EnterpriseInformation enterpriseInformation = enterpriseInformationService.selectEnterpriseInformationById(id); |
||||
|
mmap.put("enterpriseInformation", enterpriseInformation); |
||||
|
return prefix + "/edit"; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 修改保存企业信息登记 |
||||
|
*/ |
||||
|
@RequiresPermissions("code:information:edit") |
||||
|
@PostMapping("/edit") |
||||
|
@ResponseBody |
||||
|
public ZDResponse editSave(@RequestBody EnterpriseInformation enterpriseInformation) |
||||
|
{ |
||||
|
return enterpriseInformationService.updateEnterpriseInformation(enterpriseInformation) > 0 ? |
||||
|
ZDResponse.success("修改成功"): ZDResponse.error("修改失败"); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 修改保存企业信息登记 |
||||
|
*/ |
||||
|
@RequiresPermissions("code:information:unsubscribe") |
||||
|
@PostMapping("/unsubscribe") |
||||
|
@ResponseBody |
||||
|
public ZDResponse unsubscribe( EnterpriseInformation enterpriseInformation) |
||||
|
{ |
||||
|
return enterpriseInformationService.updateEnterpriseInformation(enterpriseInformation) > 0 ? |
||||
|
ZDResponse.success("注销成功"): ZDResponse.error("注销失败"); |
||||
|
} |
||||
|
/** |
||||
|
* 删除企业信息登记 |
||||
|
*/ |
||||
|
@RequiresPermissions("code:information:remove") |
||||
|
@PostMapping( "/remove") |
||||
|
@ResponseBody |
||||
|
public ZDResponse remove(String ids) |
||||
|
{ |
||||
|
return enterpriseInformationService.deleteEnterpriseInformationById(ids) > 0 ? |
||||
|
ZDResponse.success("删除成功") : ZDResponse.error("删除失败"); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 更新企业二维码信息 |
||||
|
*/ |
||||
|
@RequiresPermissions("code:information:generateQrCode") |
||||
|
@GetMapping( "/generateQrCode") |
||||
|
@ResponseBody |
||||
|
public ZDResponse generateQrCode(String enterpriseNumber) |
||||
|
{ |
||||
|
return enterpriseInformationService.generateQrCode(enterpriseNumber) > 0 ? |
||||
|
ZDResponse.success("更新成功") : ZDResponse.error("更新失败"); |
||||
|
} |
||||
|
/** |
||||
|
* 更新企业二维码信息 |
||||
|
*/ |
||||
|
@RequiresPermissions("code:information:getEnterpriseInfo") |
||||
|
@GetMapping( "/getEnterpriseInfo") |
||||
|
@ResponseBody |
||||
|
public ZDResponse getEnterpriseInfo(String id) |
||||
|
{ |
||||
|
return ZDResponse.success("查询成功", |
||||
|
enterpriseInformationService.selectEnterpriseInformationById(id)); |
||||
|
} |
||||
|
/** |
||||
|
* 查询企业二维码信息 |
||||
|
*/ |
||||
|
@RequiresPermissions("code:information:getQrCode") |
||||
|
@GetMapping("/getQrCode") |
||||
|
@ResponseBody |
||||
|
public ZDResponse getQrCode(String enterpriseNumber) |
||||
|
{ |
||||
|
//查询企业二维码信息
|
||||
|
QrCodeGenerateHistory qrCodeGenerateHistory = iQrCodeGenerateHistoryService.selectQrCodeGenerateHistoryByNewest(enterpriseNumber); |
||||
|
//查询企业信息
|
||||
|
EnterpriseInformation enterpriseInformation = new EnterpriseInformation(); |
||||
|
enterpriseInformation.setEnterpriseNumber(enterpriseNumber); |
||||
|
List<EnterpriseInformation> enterpriseInformations = enterpriseInformationService.selectEnterpriseInformationList(enterpriseInformation); |
||||
|
if(enterpriseInformations.size() > 0){ |
||||
|
qrCodeGenerateHistory.setEnterpriseName(enterpriseInformations.get(0).getEnterpriseName()); |
||||
|
} |
||||
|
return ZDResponse.success("查询成功",qrCodeGenerateHistory); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 获取企业信息 |
||||
|
* @param enterpriseNumber 盐加密之后的企业信用代码 |
||||
|
* @return |
||||
|
*/ |
||||
|
@ResponseBody |
||||
|
@GetMapping("/getEnterpriseInformation/{enterpriseNumber}") |
||||
|
public ZDResponse getEnterpriseInformation(@PathVariable("enterpriseNumber") String enterpriseNumber){ |
||||
|
//查询企业信息
|
||||
|
EnterpriseInformation enterpriseInformation = enterpriseInformationService.selectEnterpriseInformationBySalt(enterpriseNumber); |
||||
|
/*if(PasswordTools.decrypt(enterpriseInformation.getEnterpriseNumber(),enterpriseNumber)){ |
||||
|
return ZDResponse.success("查询成功",enterpriseInformation); |
||||
|
}else{ |
||||
|
return ZDResponse.error("查询失败"); |
||||
|
}*/ |
||||
|
return ZDResponse.success("查询成功",enterpriseInformation); |
||||
|
} |
||||
|
|
||||
|
@ResponseBody |
||||
|
@GetMapping("/queryHistoryQrCodeList") |
||||
|
public ZDResponse queryHistoryQrCodeList(QrCodeGenerateHistory qrCodeGenerateHistory){ |
||||
|
List<QrCodeGenerateHistory> qrCodeGenerateHistories = |
||||
|
iQrCodeGenerateHistoryService.selectQrCodeGenerateHistoryList(qrCodeGenerateHistory); |
||||
|
return ZDResponse.success("查询二维码历史记录成功",qrCodeGenerateHistories); |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,189 @@ |
|||||
|
package com.zdxt.app.controller; |
||||
|
|
||||
|
import com.zdxt.code.domain.EnterpriseLawEnforcement; |
||||
|
import com.zdxt.code.domain.LinkageDict; |
||||
|
import com.zdxt.code.service.IEnterpriseLawEnforcementService; |
||||
|
import com.zdxt.code.service.ILinkageDictService; |
||||
|
import com.zdxt.common.ZDResponse; |
||||
|
import com.zdxt.common.controller.BaseController; |
||||
|
import com.zdxt.common.util.StringUtils; |
||||
|
import com.zdxt.common.util.TableDataInfo; |
||||
|
import org.apache.shiro.authz.annotation.RequiresPermissions; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.stereotype.Controller; |
||||
|
import org.springframework.ui.ModelMap; |
||||
|
import org.springframework.web.bind.annotation.*; |
||||
|
|
||||
|
import java.util.HashMap; |
||||
|
import java.util.List; |
||||
|
import java.util.Map; |
||||
|
|
||||
|
/** |
||||
|
* 企业端-执法部门预约记录Controller |
||||
|
* |
||||
|
* @author chenrui |
||||
|
* @date 2024-02-21 |
||||
|
*/ |
||||
|
@Controller |
||||
|
@RequestMapping("/app/code/enforcement") |
||||
|
public class AppEnterpriseLawEnforcementController extends BaseController |
||||
|
{ |
||||
|
private String prefix = "code/enforcement"; |
||||
|
|
||||
|
@Autowired |
||||
|
private IEnterpriseLawEnforcementService enterpriseLawEnforcementService; |
||||
|
@Autowired private ILinkageDictService iLinkageDictService; |
||||
|
|
||||
|
@RequiresPermissions("code:enforcement:view") |
||||
|
@GetMapping() |
||||
|
public String enforcement() |
||||
|
{ |
||||
|
return prefix + "/enforcement"; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 查询企业端-执法部门预约记录列表 |
||||
|
*/ |
||||
|
@RequiresPermissions("code:enforcement:list") |
||||
|
@PostMapping("/list") |
||||
|
@ResponseBody |
||||
|
public TableDataInfo list(EnterpriseLawEnforcement enterpriseLawEnforcement) |
||||
|
{ |
||||
|
startPage(); |
||||
|
List<EnterpriseLawEnforcement> list = enterpriseLawEnforcementService.selectEnterpriseLawEnforcementList(enterpriseLawEnforcement); |
||||
|
return getDataTable(list); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 查询企业端-执法部门预约记录列表 |
||||
|
*/ |
||||
|
@RequiresPermissions("code:enforcement:queryList") |
||||
|
@GetMapping("/queryList") |
||||
|
@ResponseBody |
||||
|
public ZDResponse queryList(EnterpriseLawEnforcement enterpriseLawEnforcement) |
||||
|
{ |
||||
|
List<EnterpriseLawEnforcement> list = enterpriseLawEnforcementService.selectEnterpriseLawEnforcementList(enterpriseLawEnforcement); |
||||
|
return ZDResponse.success("查询成功",list); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 新增企业端-执法部门预约记录 |
||||
|
*/ |
||||
|
@GetMapping("/add") |
||||
|
public String add() |
||||
|
{ |
||||
|
return prefix + "/add"; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 新增保存企业端-执法部门预约记录 |
||||
|
*/ |
||||
|
// @RequiresPermissions("code:enforcement:add")
|
||||
|
@PostMapping("/add") |
||||
|
@ResponseBody |
||||
|
public ZDResponse addSave(@RequestBody EnterpriseLawEnforcement enterpriseLawEnforcement) |
||||
|
{ |
||||
|
return enterpriseLawEnforcementService.insertEnterpriseLawEnforcement(enterpriseLawEnforcement) > 0 ? ZDResponse.success("预约成功") : ZDResponse.error("预约失败"); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 修改企业端-执法部门预约记录 |
||||
|
*/ |
||||
|
@GetMapping("/edit/{id}") |
||||
|
public String edit(@PathVariable("id") String id, ModelMap mmap) |
||||
|
{ |
||||
|
EnterpriseLawEnforcement enterpriseLawEnforcement = enterpriseLawEnforcementService.selectEnterpriseLawEnforcementById(id); |
||||
|
mmap.put("enterpriseLawEnforcement", enterpriseLawEnforcement); |
||||
|
return prefix + "/edit"; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 取消预约 |
||||
|
*/ |
||||
|
@PutMapping("/cancel/{id}") |
||||
|
@ResponseBody |
||||
|
public ZDResponse cancel(@PathVariable("id") String id) |
||||
|
{ |
||||
|
int i = enterpriseLawEnforcementService.cancel(id); |
||||
|
return i > 0 ? ZDResponse.success("取消成功") : ZDResponse.error("取消失败"); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 修改保存企业端-执法部门预约记录 |
||||
|
*/ |
||||
|
@RequiresPermissions("code:enforcement:edit") |
||||
|
@PostMapping("/edit") |
||||
|
@ResponseBody |
||||
|
public ZDResponse editSave(@RequestBody EnterpriseLawEnforcement enterpriseLawEnforcement) |
||||
|
{ |
||||
|
int resNum = 0; |
||||
|
enterpriseLawEnforcement.setIsSubmit(1); |
||||
|
if (StringUtils.isNotEmpty(enterpriseLawEnforcement.getId())) { |
||||
|
resNum = enterpriseLawEnforcementService.updateEnterpriseLawEnforcement(enterpriseLawEnforcement); |
||||
|
} else { |
||||
|
resNum = enterpriseLawEnforcementService.insertEnterpriseLawEnforcement(enterpriseLawEnforcement); |
||||
|
} |
||||
|
return resNum > 0 ? ZDResponse.success("修改成功") : ZDResponse.error("修改失败"); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 删除企业端-执法部门预约记录 |
||||
|
*/ |
||||
|
@RequiresPermissions("code:enforcement:remove") |
||||
|
@PostMapping( "/remove") |
||||
|
@ResponseBody |
||||
|
public ZDResponse remove(String ids) |
||||
|
{ |
||||
|
return enterpriseLawEnforcementService.deleteEnterpriseLawEnforcementByIds(ids) > 0 ? |
||||
|
ZDResponse.success("删除成功") : ZDResponse.error("删除失败"); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 查看预约记录详情 |
||||
|
*/ |
||||
|
@GetMapping( "/getById/{id}") |
||||
|
@ResponseBody |
||||
|
public ZDResponse getById(@PathVariable("id") String id) |
||||
|
{ |
||||
|
EnterpriseLawEnforcement enterpriseLawEnforcement = |
||||
|
enterpriseLawEnforcementService.selectEnterpriseLawEnforcementById(id); |
||||
|
return ZDResponse.success("查询成功",enterpriseLawEnforcement); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 查看预约记录详情 |
||||
|
*/ |
||||
|
@GetMapping( "/getByUserIdAndZero") |
||||
|
@ResponseBody |
||||
|
public ZDResponse getByUserIdAndZero() |
||||
|
{ |
||||
|
EnterpriseLawEnforcement enfrorcement = enterpriseLawEnforcementService.getByUserIdAndZero(); |
||||
|
Map<String, Object> params = new HashMap<>(); |
||||
|
LinkageDict tmp = iLinkageDictService.selectLinkageDictById(enfrorcement.getCheckItem()); |
||||
|
params.put("checkItemText", tmp.getTitle()); |
||||
|
tmp = iLinkageDictService.selectLinkageDictById(enfrorcement.getCheckRequire()); |
||||
|
params.put("checkRequireText", tmp.getTitle()); |
||||
|
enfrorcement.setParams(params); |
||||
|
return ZDResponse.success("查询成功", enfrorcement); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 查看预约记录详情 |
||||
|
*/ |
||||
|
@GetMapping( "/getByIdToDataFillIn/{id}") |
||||
|
@ResponseBody |
||||
|
public ZDResponse getByIdToDataFillIn(@PathVariable String id) |
||||
|
{ |
||||
|
EnterpriseLawEnforcement enfrorcement = enterpriseLawEnforcementService.getEnterpriseLawEnforcementById(id); |
||||
|
Map<String, Object> params = new HashMap<>(); |
||||
|
LinkageDict tmp = iLinkageDictService.selectLinkageDictById(enfrorcement.getCheckItem()); |
||||
|
params.put("checkItemText", tmp.getTitle()); |
||||
|
tmp = iLinkageDictService.selectLinkageDictById(enfrorcement.getCheckRequire()); |
||||
|
params.put("checkRequireText", tmp.getTitle()); |
||||
|
enfrorcement.setParams(params); |
||||
|
return ZDResponse.success("查询成功", enfrorcement); |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,143 @@ |
|||||
|
package com.zdxt.app.controller; |
||||
|
|
||||
|
import com.zdxt.code.domain.EnterpriseMerchantAuthorization; |
||||
|
import com.zdxt.code.service.IEnterpriseMerchantAuthorizationService; |
||||
|
import com.zdxt.common.ZDResponse; |
||||
|
import com.zdxt.common.controller.BaseController; |
||||
|
import com.zdxt.common.util.TableDataInfo; |
||||
|
import org.apache.shiro.authz.annotation.RequiresPermissions; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.stereotype.Controller; |
||||
|
import org.springframework.ui.ModelMap; |
||||
|
import org.springframework.web.bind.annotation.*; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* 商户授权企业信息Controller |
||||
|
* |
||||
|
* @author chenrui |
||||
|
* @date 2024-02-23 |
||||
|
*/ |
||||
|
@Controller |
||||
|
@RequestMapping("/app/code/authorization") |
||||
|
public class AppEnterpriseMerchantAuthorizationController extends BaseController |
||||
|
{ |
||||
|
private String prefix = "code/authorization"; |
||||
|
|
||||
|
@Autowired |
||||
|
private IEnterpriseMerchantAuthorizationService enterpriseMerchantAuthorizationService; |
||||
|
|
||||
|
@RequiresPermissions("code:authorization:view") |
||||
|
@GetMapping() |
||||
|
public String authorization() |
||||
|
{ |
||||
|
return prefix + "/authorization"; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 查询商户授权企业信息列表 |
||||
|
*/ |
||||
|
@RequiresPermissions("code:authorization:list") |
||||
|
@PostMapping("/list") |
||||
|
@ResponseBody |
||||
|
public TableDataInfo list(EnterpriseMerchantAuthorization enterpriseMerchantAuthorization) |
||||
|
{ |
||||
|
startPage(); |
||||
|
List<EnterpriseMerchantAuthorization> list = enterpriseMerchantAuthorizationService.selectEnterpriseMerchantAuthorizationList(enterpriseMerchantAuthorization); |
||||
|
return getDataTable(list); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 查询商户授权企业信息列表 |
||||
|
*/ |
||||
|
// @RequiresPermissions("code:authorization:list")
|
||||
|
@GetMapping("/queryList") |
||||
|
@ResponseBody |
||||
|
public ZDResponse queryList(EnterpriseMerchantAuthorization enterpriseMerchantAuthorization) |
||||
|
{ |
||||
|
List<EnterpriseMerchantAuthorization> list = enterpriseMerchantAuthorizationService.selectEnterpriseMerchantAuthorizationList(enterpriseMerchantAuthorization); |
||||
|
return ZDResponse.success("查询成功",list); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 新增商户授权企业信息 |
||||
|
*/ |
||||
|
@GetMapping("/add") |
||||
|
public String add() |
||||
|
{ |
||||
|
return prefix + "/add"; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 新增保存商户授权企业信息 |
||||
|
*/ |
||||
|
@RequiresPermissions("code:authorization:add") |
||||
|
@PostMapping("/add") |
||||
|
@ResponseBody |
||||
|
public ZDResponse addSave(@RequestBody EnterpriseMerchantAuthorization enterpriseMerchantAuthorization) |
||||
|
{ |
||||
|
return enterpriseMerchantAuthorizationService.insertEnterpriseMerchantAuthorization(enterpriseMerchantAuthorization) |
||||
|
> 0 ? ZDResponse.success("保存成功") : ZDResponse.error("保存失败"); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 修改商户授权企业信息 |
||||
|
*/ |
||||
|
@GetMapping("/edit/{id}") |
||||
|
public String edit(@PathVariable("id") String id, ModelMap mmap) |
||||
|
{ |
||||
|
EnterpriseMerchantAuthorization enterpriseMerchantAuthorization = enterpriseMerchantAuthorizationService.selectEnterpriseMerchantAuthorizationById(id); |
||||
|
mmap.put("enterpriseMerchantAuthorization", enterpriseMerchantAuthorization); |
||||
|
return prefix + "/edit"; |
||||
|
} |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 重新授权企业 |
||||
|
*/ |
||||
|
@PostMapping("/reauthorize") |
||||
|
@ResponseBody |
||||
|
public String reauthorize(@PathVariable("id") String id, ModelMap mmap) |
||||
|
{ |
||||
|
EnterpriseMerchantAuthorization enterpriseMerchantAuthorization = enterpriseMerchantAuthorizationService.selectEnterpriseMerchantAuthorizationById(id); |
||||
|
mmap.put("enterpriseMerchantAuthorization", enterpriseMerchantAuthorization); |
||||
|
return prefix + "/edit"; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 修改保存商户授权企业信息 |
||||
|
*/ |
||||
|
@RequiresPermissions("code:authorization:edit") |
||||
|
@PostMapping("/edit") |
||||
|
@ResponseBody |
||||
|
public ZDResponse editSave(EnterpriseMerchantAuthorization enterpriseMerchantAuthorization) |
||||
|
{ |
||||
|
return enterpriseMerchantAuthorizationService.updateEnterpriseMerchantAuthorization(enterpriseMerchantAuthorization) |
||||
|
> 0 ? ZDResponse.success("保存成功"): ZDResponse.error("修改失败"); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 删除商户授权企业信息 |
||||
|
*/ |
||||
|
@RequiresPermissions("code:authorization:remove") |
||||
|
@PostMapping( "/remove") |
||||
|
@ResponseBody |
||||
|
public ZDResponse remove(String ids) |
||||
|
{ |
||||
|
return enterpriseMerchantAuthorizationService.deleteEnterpriseMerchantAuthorizationByIds(ids) > 0 |
||||
|
? ZDResponse.success("删除成功") : ZDResponse.error("删除失败"); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 取消授权 |
||||
|
*/ |
||||
|
@RequiresPermissions("code:authorization:cancelAuthorization") |
||||
|
@DeleteMapping( "/cancelAuthorization") |
||||
|
@ResponseBody |
||||
|
public ZDResponse cancelAuthorization(String id) |
||||
|
{ |
||||
|
return enterpriseMerchantAuthorizationService.deleteEnterpriseMerchantAuthorizationById(id) > 0 |
||||
|
? ZDResponse.success("取消授权成功") : ZDResponse.error("取消授权失败"); |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,120 @@ |
|||||
|
package com.zdxt.app.controller; |
||||
|
|
||||
|
import com.zdxt.code.domain.LawEnforcementWarningList; |
||||
|
import com.zdxt.code.service.ILawEnforcementWarningListService; |
||||
|
import com.zdxt.common.ZDResponse; |
||||
|
import com.zdxt.common.controller.BaseController; |
||||
|
import com.zdxt.common.util.TableDataInfo; |
||||
|
import org.apache.shiro.authz.annotation.RequiresPermissions; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.stereotype.Controller; |
||||
|
import org.springframework.ui.ModelMap; |
||||
|
import org.springframework.web.bind.annotation.*; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 执法预警列表Controller |
||||
|
* |
||||
|
* @author chenrui |
||||
|
* @date 2024-03-22 |
||||
|
*/ |
||||
|
@Controller |
||||
|
@RequestMapping("/app/code/LawEnforcementWarningList") |
||||
|
public class AppLawEnforcementWarningListController extends BaseController |
||||
|
{ |
||||
|
private String prefix = "project/code/LawEnforcementWarningList"; |
||||
|
|
||||
|
@Autowired |
||||
|
private ILawEnforcementWarningListService lawEnforcementWarningListService; |
||||
|
|
||||
|
@RequiresPermissions("code:LawEnforcementWarningList:view") |
||||
|
@GetMapping() |
||||
|
public String LawEnforcementWarningList() |
||||
|
{ |
||||
|
return prefix + "/LawEnforcementWarningList"; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 查询执法预警列表列表 |
||||
|
*/ |
||||
|
// @RequiresPermissions("code:LawEnforcementWarningList:list")
|
||||
|
@PostMapping("/list") |
||||
|
@ResponseBody |
||||
|
public TableDataInfo list(LawEnforcementWarningList lawEnforcementWarningList) |
||||
|
{ |
||||
|
startPage(); |
||||
|
List<LawEnforcementWarningList> list = lawEnforcementWarningListService.selectLawEnforcementWarningListList(lawEnforcementWarningList); |
||||
|
return getDataTable(list); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 查询执法预警列表列表 |
||||
|
*/ |
||||
|
// @RequiresPermissions("code:LawEnforcementWarningList:queryList")
|
||||
|
@GetMapping("/queryList") |
||||
|
@ResponseBody |
||||
|
public ZDResponse queryList(LawEnforcementWarningList lawEnforcementWarningList) |
||||
|
{ |
||||
|
List<LawEnforcementWarningList> list = lawEnforcementWarningListService.selectLawEnforcementWarningListList(lawEnforcementWarningList); |
||||
|
return ZDResponse.success("查询成功",list); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 新增执法预警列表 |
||||
|
*/ |
||||
|
@GetMapping("/add") |
||||
|
public String add() |
||||
|
{ |
||||
|
return prefix + "/add"; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 新增保存执法预警列表 |
||||
|
*/ |
||||
|
@RequiresPermissions("code:LawEnforcementWarningList:add") |
||||
|
@PostMapping("/add") |
||||
|
@ResponseBody |
||||
|
public ZDResponse addSave(LawEnforcementWarningList lawEnforcementWarningList) |
||||
|
{ |
||||
|
return lawEnforcementWarningListService.insertLawEnforcementWarningList(lawEnforcementWarningList) |
||||
|
> 0 ? ZDResponse.success("保存成功") : ZDResponse.error("保存成功"); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 修改执法预警列表 |
||||
|
*/ |
||||
|
@GetMapping("/edit/{id}") |
||||
|
public String edit(@PathVariable("id") String id, ModelMap mmap) |
||||
|
{ |
||||
|
LawEnforcementWarningList lawEnforcementWarningList = lawEnforcementWarningListService.selectLawEnforcementWarningListById(id); |
||||
|
mmap.put("lawEnforcementWarningList", lawEnforcementWarningList); |
||||
|
return prefix + "/edit"; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 修改保存执法预警列表 |
||||
|
*/ |
||||
|
@RequiresPermissions("code:LawEnforcementWarningList:edit") |
||||
|
@PostMapping("/edit") |
||||
|
@ResponseBody |
||||
|
public ZDResponse editSave(LawEnforcementWarningList lawEnforcementWarningList) |
||||
|
{ |
||||
|
return lawEnforcementWarningListService.updateLawEnforcementWarningList(lawEnforcementWarningList) |
||||
|
> 0 ? ZDResponse.success("修改成功"): ZDResponse.error("修改失败"); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 删除执法预警列表 |
||||
|
*/ |
||||
|
@RequiresPermissions("code:LawEnforcementWarningList:remove") |
||||
|
@PostMapping( "/remove") |
||||
|
@ResponseBody |
||||
|
public ZDResponse remove(String ids) |
||||
|
{ |
||||
|
return lawEnforcementWarningListService.deleteLawEnforcementWarningListByIds(ids) > 0? |
||||
|
ZDResponse.success("删除成功") : ZDResponse.error("删除失败"); |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,174 @@ |
|||||
|
package com.zdxt.app.controller; |
||||
|
|
||||
|
import com.zdxt.code.domain.LinkageDict; |
||||
|
import com.zdxt.code.service.ILinkageDictService; |
||||
|
import com.zdxt.common.ZDResponse; |
||||
|
import com.zdxt.common.Ztree; |
||||
|
import com.zdxt.common.controller.BaseController; |
||||
|
import com.zdxt.common.util.StringUtils; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.stereotype.Controller; |
||||
|
import org.springframework.ui.ModelMap; |
||||
|
import org.springframework.web.bind.annotation.*; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* 联动字典Controller |
||||
|
* |
||||
|
* @author ruoyi |
||||
|
* @date 2024-04-12 |
||||
|
*/ |
||||
|
@Controller |
||||
|
@RequestMapping("/app/code/linkage") |
||||
|
public class AppLinkageDictController extends BaseController |
||||
|
{ |
||||
|
private String prefix = "project/code/linkage"; |
||||
|
|
||||
|
@Autowired |
||||
|
private ILinkageDictService linkageDictService; |
||||
|
|
||||
|
// @RequiresPermissions("code:linkage:view")
|
||||
|
@GetMapping() |
||||
|
public String view() |
||||
|
{ |
||||
|
return prefix + "/view"; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 查询联动字典列表 |
||||
|
*/ |
||||
|
// @RequiresPermissions("code:linkage:view")
|
||||
|
@PostMapping("/listToPC") |
||||
|
@ResponseBody |
||||
|
public List<LinkageDict> listToPC(LinkageDict linkageDict) |
||||
|
{ |
||||
|
List<LinkageDict> list = linkageDictService.selectLinkageDictList(linkageDict); |
||||
|
return list; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 查询联动字典列表 |
||||
|
*/ |
||||
|
// @RequiresPermissions("code:linkage:view")
|
||||
|
@PostMapping("/list") |
||||
|
@ResponseBody |
||||
|
public List<LinkageDict> list(@RequestBody LinkageDict linkageDict) |
||||
|
{ |
||||
|
List<LinkageDict> list = linkageDictService.selectLinkageDictList(linkageDict); |
||||
|
return list; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 查询联动字典列表 |
||||
|
*/ |
||||
|
// @RequiresPermissions("code:linkage:view")
|
||||
|
@PostMapping("/objById") |
||||
|
@ResponseBody |
||||
|
public LinkageDict objById(@RequestBody LinkageDict linkageDict) |
||||
|
{ |
||||
|
LinkageDict obj = linkageDictService.selectLinkageDictById(linkageDict.getId()); |
||||
|
return obj; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 查询联动字典列表 |
||||
|
*/ |
||||
|
// @RequiresPermissions("code:linkage:view")
|
||||
|
@PostMapping("/selectLinkageDictByValueAndParentId") |
||||
|
@ResponseBody |
||||
|
public LinkageDict selectLinkageDictByValueAndParentId(@RequestBody LinkageDict linkageDict) |
||||
|
{ |
||||
|
LinkageDict obj = linkageDictService.selectLinkageDictByValueAndParentId(linkageDict.getValue(), linkageDict.getParentId()); |
||||
|
return obj; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 新增联动字典 |
||||
|
*/ |
||||
|
@GetMapping("/add/{parentId}") |
||||
|
public String add(@PathVariable("parentId") String parentId, ModelMap mmap) |
||||
|
{ |
||||
|
mmap.put("linkage", linkageDictService.selectLinkageDictById(parentId)); |
||||
|
return prefix + "/add"; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 新增保存联动字典 |
||||
|
*/ |
||||
|
// @RequiresPermissions("code:linkage:add")
|
||||
|
@PostMapping("/add") |
||||
|
@ResponseBody |
||||
|
public ZDResponse addSave(LinkageDict linkageDict) |
||||
|
{ |
||||
|
return linkageDictService.insertLinkageDict(linkageDict) > 0 ? ZDResponse.success("操作成功") : ZDResponse.error("操作失败"); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 修改联动字典 |
||||
|
*/ |
||||
|
@GetMapping("/edit/{id}") |
||||
|
public String edit(@PathVariable("id") String id, ModelMap mmap) |
||||
|
{ |
||||
|
LinkageDict linkageDict = linkageDictService.selectLinkageDictById(id); |
||||
|
if (StringUtils.isNotNull(linkageDict) && "100".equals(id)) |
||||
|
{ |
||||
|
linkageDict.setParentName("无"); |
||||
|
} |
||||
|
mmap.put("linkage", linkageDict); |
||||
|
return prefix + "/edit"; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 修改保存联动字典 |
||||
|
*/ |
||||
|
// @RequiresPermissions("code:linkage:edit")
|
||||
|
@PostMapping("/edit") |
||||
|
@ResponseBody |
||||
|
public ZDResponse editSave(LinkageDict linkageDict) |
||||
|
{ |
||||
|
return linkageDictService.updateLinkageDict(linkageDict) > 0 ? ZDResponse.success("操作成功") : ZDResponse.error("操作失败"); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 删除联动字典 |
||||
|
*/ |
||||
|
// @RequiresPermissions("code:linkage:remove")
|
||||
|
@PostMapping( "/remove") |
||||
|
@ResponseBody |
||||
|
public ZDResponse remove(String ids) |
||||
|
{ |
||||
|
return linkageDictService.deleteLinkageDictByIds(ids) > 0 ? ZDResponse.success("操作成功") : ZDResponse.error("操作失败"); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 校验节点名称 |
||||
|
*/ |
||||
|
@PostMapping("/checkItemNameUnique") |
||||
|
@ResponseBody |
||||
|
public String checkItemNameUnique(LinkageDict dict) |
||||
|
{ |
||||
|
return linkageDictService.checkItemNameUnique(dict); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 选择节点树 |
||||
|
*/ |
||||
|
@GetMapping("/selectItemTree/{id}") |
||||
|
public String selectDeptTree(@PathVariable("id") String id, ModelMap mmap) |
||||
|
{ |
||||
|
mmap.put("linkage", linkageDictService.selectLinkageDictById(id)); |
||||
|
return prefix + "/tree"; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 加载节点列表树 |
||||
|
*/ |
||||
|
@GetMapping("/treeData") |
||||
|
@ResponseBody |
||||
|
public List<Ztree> treeData() |
||||
|
{ |
||||
|
List<Ztree> ztrees = linkageDictService.selectItemTree(new LinkageDict()); |
||||
|
return ztrees; |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,39 @@ |
|||||
|
package com.zdxt.app.controller; |
||||
|
|
||||
|
import com.zdxt.code.domain.QrCodeGenerateHistory; |
||||
|
import com.zdxt.code.service.IQrCodeGenerateHistoryService; |
||||
|
import com.zdxt.common.ZDResponse; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.stereotype.Controller; |
||||
|
import org.springframework.web.bind.annotation.GetMapping; |
||||
|
import org.springframework.web.bind.annotation.RequestMapping; |
||||
|
import org.springframework.web.bind.annotation.ResponseBody; |
||||
|
import org.springframework.web.bind.annotation.RestController; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* 商户管理 -控制层 |
||||
|
*/ |
||||
|
@RestController |
||||
|
@Controller |
||||
|
@RequestMapping("/app/merchantManagement") |
||||
|
public class AppMerchantManagementController { |
||||
|
|
||||
|
@Autowired |
||||
|
private IQrCodeGenerateHistoryService qrCodeGenerateHistoryService; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 查询二维码 |
||||
|
* @param qrCodeGenerateHistory |
||||
|
* @return |
||||
|
*/ |
||||
|
@GetMapping("/queryQrCodeList") |
||||
|
@ResponseBody |
||||
|
public ZDResponse queryQrCodeList(QrCodeGenerateHistory qrCodeGenerateHistory){ |
||||
|
List<QrCodeGenerateHistory> qrCodeGenerateHistories = |
||||
|
qrCodeGenerateHistoryService.selectQrCodeGenerateHistoryList(qrCodeGenerateHistory); |
||||
|
return ZDResponse.success("查询成功",qrCodeGenerateHistories); |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,107 @@ |
|||||
|
package com.zdxt.app.controller; |
||||
|
|
||||
|
import com.zdxt.code.domain.RuleItemList; |
||||
|
import com.zdxt.code.service.IRuleItemListService; |
||||
|
import com.zdxt.common.ZDResponse; |
||||
|
import com.zdxt.common.controller.BaseController; |
||||
|
import com.zdxt.common.util.TableDataInfo; |
||||
|
import org.apache.shiro.authz.annotation.RequiresPermissions; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.stereotype.Controller; |
||||
|
import org.springframework.ui.ModelMap; |
||||
|
import org.springframework.web.bind.annotation.*; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* 规则项Controller |
||||
|
* |
||||
|
* @author chenrui |
||||
|
* @date 2024-02-28 |
||||
|
*/ |
||||
|
@Controller |
||||
|
@RequestMapping("/app/code/ruleItemList") |
||||
|
public class AppRuleItemListController extends BaseController |
||||
|
{ |
||||
|
private String prefix = "project/code/ruleItemList"; |
||||
|
|
||||
|
@Autowired |
||||
|
private IRuleItemListService ruleItemListService; |
||||
|
|
||||
|
@RequiresPermissions("code:ruleItemList:view") |
||||
|
@GetMapping() |
||||
|
public String list() |
||||
|
{ |
||||
|
return prefix + "/ruleItemList"; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 查询规则项列表 |
||||
|
*/ |
||||
|
@RequiresPermissions("code:ruleItemList:list") |
||||
|
@PostMapping("/list") |
||||
|
@ResponseBody |
||||
|
public TableDataInfo list(RuleItemList ruleItemList) |
||||
|
{ |
||||
|
startPage(); |
||||
|
List<RuleItemList> list = ruleItemListService.selectRuleItemListList(ruleItemList); |
||||
|
return getDataTable(list); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 新增规则项 |
||||
|
*/ |
||||
|
@GetMapping("/add/{id}") |
||||
|
public String add(@PathVariable("id") String ruleId,ModelMap mmp) |
||||
|
{ |
||||
|
mmp.put("ruleId",ruleId); |
||||
|
return prefix + "/add"; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 新增保存规则项 |
||||
|
*/ |
||||
|
@RequiresPermissions("code:ruleItemList:add") |
||||
|
@PostMapping("/add") |
||||
|
@ResponseBody |
||||
|
public ZDResponse addSave(RuleItemList ruleItemList) |
||||
|
{ |
||||
|
return ruleItemListService.insertRuleItemList(ruleItemList) > 0 ? |
||||
|
ZDResponse.success("添加成功") : ZDResponse.error("添加失败"); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 修改规则项 |
||||
|
*/ |
||||
|
@GetMapping("/edit/{id}") |
||||
|
public String edit(@PathVariable("id") String id, ModelMap mmap) |
||||
|
{ |
||||
|
RuleItemList ruleItemList = ruleItemListService.selectRuleItemListById(id); |
||||
|
mmap.put("ruleItemList", ruleItemList); |
||||
|
return prefix + "/edit"; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 修改保存规则项 |
||||
|
*/ |
||||
|
@RequiresPermissions("code:ruleItemList:edit") |
||||
|
@PostMapping("/edit") |
||||
|
@ResponseBody |
||||
|
public ZDResponse editSave(RuleItemList ruleItemList) |
||||
|
{ |
||||
|
return ruleItemListService.updateRuleItemList(ruleItemList) > 0 ? |
||||
|
ZDResponse.success("修改成功"):ZDResponse.error("修改失败"); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 删除规则项 |
||||
|
*/ |
||||
|
@RequiresPermissions("code:ruleItemList:remove") |
||||
|
@PostMapping( "/remove") |
||||
|
@ResponseBody |
||||
|
public ZDResponse remove(String ids) |
||||
|
{ |
||||
|
return ruleItemListService.deleteRuleItemListByIds(ids) > 0 ? ZDResponse.success("删除成功") : ZDResponse.error("删除失败"); |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,121 @@ |
|||||
|
package com.zdxt.app.controller; |
||||
|
|
||||
|
import com.zdxt.code.domain.RuleList; |
||||
|
import com.zdxt.code.service.IRuleItemListService; |
||||
|
import com.zdxt.code.service.IRuleListService; |
||||
|
import com.zdxt.common.ZDResponse; |
||||
|
import com.zdxt.common.controller.BaseController; |
||||
|
import com.zdxt.common.util.TableDataInfo; |
||||
|
import org.apache.shiro.authz.annotation.RequiresPermissions; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.stereotype.Controller; |
||||
|
import org.springframework.ui.ModelMap; |
||||
|
import org.springframework.web.bind.annotation.*; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 规则列表Controller |
||||
|
* |
||||
|
* @author chenrui |
||||
|
* @date 2024-02-28 |
||||
|
*/ |
||||
|
@Controller |
||||
|
@RequestMapping("/app/code/ruleList") |
||||
|
public class AppRuleListController extends BaseController |
||||
|
{ |
||||
|
private String prefix = "project/code/ruleList"; |
||||
|
|
||||
|
@Autowired |
||||
|
private IRuleListService ruleListService; |
||||
|
|
||||
|
@Autowired |
||||
|
private IRuleItemListService iRuleItemListService; |
||||
|
|
||||
|
@RequiresPermissions("code:ruleList:view") |
||||
|
@GetMapping() |
||||
|
public String list() |
||||
|
{ |
||||
|
return prefix + "/list"; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 查询规则列列表 |
||||
|
*/ |
||||
|
@RequiresPermissions("code:ruleList:list") |
||||
|
@PostMapping("/list") |
||||
|
@ResponseBody |
||||
|
public TableDataInfo list(RuleList ruleList) |
||||
|
{ |
||||
|
startPage(); |
||||
|
List<RuleList> list = ruleListService.selectRuleListList(ruleList); |
||||
|
return getDataTable(list); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 新增规则列 |
||||
|
*/ |
||||
|
@GetMapping("/add") |
||||
|
public String add() |
||||
|
{ |
||||
|
return prefix + "/add"; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 新增保存规则列 |
||||
|
*/ |
||||
|
@RequiresPermissions("code:ruleList:add") |
||||
|
@PostMapping("/add") |
||||
|
@ResponseBody |
||||
|
public ZDResponse addSave(RuleList ruleList) |
||||
|
{ |
||||
|
return ruleListService.insertRuleList(ruleList) > 0 ? ZDResponse.success("添加成功") |
||||
|
: ZDResponse.error("添加失败"); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 修改规则列 |
||||
|
*/ |
||||
|
@GetMapping("/edit/{id}") |
||||
|
public String edit(@PathVariable("id") String id, ModelMap mmap) |
||||
|
{ |
||||
|
RuleList ruleList = ruleListService.selectRuleListById(id); |
||||
|
mmap.put("ruleList", ruleList); |
||||
|
return prefix + "/edit"; |
||||
|
} |
||||
|
/** |
||||
|
* 修改规则列 |
||||
|
*/ |
||||
|
@GetMapping("/detail/{id}") |
||||
|
public String detail(@PathVariable("id") String id, ModelMap mmap) |
||||
|
{ |
||||
|
mmap.put("ruleId", id); |
||||
|
return "project/code/ruleItemList/ruleItemList"; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 修改保存规则列 |
||||
|
*/ |
||||
|
@RequiresPermissions("code:ruleList:edit") |
||||
|
@PostMapping("/edit") |
||||
|
@ResponseBody |
||||
|
public ZDResponse editSave(RuleList ruleList) |
||||
|
{ |
||||
|
return ruleListService.updateRuleList(ruleList) > 0 ? |
||||
|
ZDResponse.success("修改成功") : ZDResponse.error("修改失败"); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 删除规则列 |
||||
|
*/ |
||||
|
@RequiresPermissions("code:list:remove") |
||||
|
@PostMapping( "/remove") |
||||
|
@ResponseBody |
||||
|
public ZDResponse remove(String ids) |
||||
|
{ |
||||
|
return ruleListService.deleteRuleListByIds(ids) > 0 ? |
||||
|
ZDResponse.success("删除成功") : ZDResponse.error("删除失败"); |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,54 @@ |
|||||
|
package com.zdxt.app.controller; |
||||
|
|
||||
|
import com.zdxt.code.domain.StatisticalVo; |
||||
|
import com.zdxt.code.service.StatisticalService; |
||||
|
import com.zdxt.common.ZDResponse; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.stereotype.Controller; |
||||
|
import org.springframework.ui.ModelMap; |
||||
|
import org.springframework.web.bind.annotation.GetMapping; |
||||
|
import org.springframework.web.bind.annotation.RequestMapping; |
||||
|
import org.springframework.web.bind.annotation.ResponseBody; |
||||
|
|
||||
|
import java.util.List; |
||||
|
import java.util.Map; |
||||
|
|
||||
|
@Controller |
||||
|
@RequestMapping("/app/statistical") |
||||
|
public class AppStatisticalController { |
||||
|
|
||||
|
private String prefix = "project/code/statistical"; |
||||
|
|
||||
|
private String prefix2 = "project/code/analysis"; |
||||
|
|
||||
|
@Autowired |
||||
|
private StatisticalService statisticalService; |
||||
|
|
||||
|
@GetMapping("/view") |
||||
|
public String statistical(StatisticalVo statisticalVo, ModelMap mmp){ |
||||
|
|
||||
|
return prefix + "/statistical"; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 统计分析 |
||||
|
* @param mmp |
||||
|
* @return |
||||
|
*/ |
||||
|
@GetMapping("/analysis") |
||||
|
public String analysis(StatisticalVo statisticalVo,ModelMap mmp){ |
||||
|
List<StatisticalVo> statisticalVos = statisticalService.StatisticalCaseload(statisticalVo); |
||||
|
mmp.put("statisticalVos",statisticalVos); |
||||
|
return prefix2 + "/analysis"; |
||||
|
} |
||||
|
/** |
||||
|
* 执法端H5统计 |
||||
|
* @return |
||||
|
*/ |
||||
|
@GetMapping("/statisticalData") |
||||
|
@ResponseBody |
||||
|
public ZDResponse statisticalData(StatisticalVo statisticalVo){ |
||||
|
Map<String, Object> map = statisticalService.statisticalData(statisticalVo); |
||||
|
return ZDResponse.success("查询成功",map); |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,83 @@ |
|||||
|
package com.zdxt.app.controller; |
||||
|
|
||||
|
import cn.hutool.core.bean.BeanUtil; |
||||
|
import com.zdxt.auth.dto.PostBean; |
||||
|
import com.zdxt.auth.dto.UserBean; |
||||
|
import com.zdxt.auth.feign.PostApi; |
||||
|
import com.zdxt.auth.feign.UserApi; |
||||
|
import com.zdxt.auth.project.system.dict.service.IDictDataService; |
||||
|
import com.zdxt.auth.project.system.user.service.IUserService; |
||||
|
import com.zdxt.common.ZDResponse; |
||||
|
import com.zdxt.common.controller.BaseController; |
||||
|
import com.zdxt.domain.auth.DictData; |
||||
|
import com.zdxt.domain.auth.Post; |
||||
|
import com.zdxt.domain.auth.User; |
||||
|
import org.apache.shiro.authz.annotation.RequiresPermissions; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.stereotype.Controller; |
||||
|
import org.springframework.web.bind.annotation.*; |
||||
|
|
||||
|
import java.util.ArrayList; |
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* @Author: kylin |
||||
|
* @Date: 2024/5/1 3:00 下午 |
||||
|
* @Version: 1.0 |
||||
|
* @Desc: TODO |
||||
|
*/ |
||||
|
@Controller |
||||
|
@RequestMapping("/app") |
||||
|
public class AppSystemController extends BaseController { |
||||
|
|
||||
|
@Autowired |
||||
|
private UserApi userApi; |
||||
|
|
||||
|
@Autowired |
||||
|
private IDictDataService dictDataService; |
||||
|
|
||||
|
@Autowired |
||||
|
private IUserService userService; |
||||
|
|
||||
|
@Autowired |
||||
|
private PostApi postApi; |
||||
|
|
||||
|
@GetMapping("/getUserInfo") |
||||
|
@ResponseBody |
||||
|
public ZDResponse getUserInfo(){ |
||||
|
UserBean user = userApi.getCurrentUser(); |
||||
|
return ZDResponse.success("查询成功",user); |
||||
|
} |
||||
|
|
||||
|
@GetMapping("/queryDict") |
||||
|
@ResponseBody |
||||
|
public ZDResponse queryDict(DictData dictData) |
||||
|
{ |
||||
|
List<DictData> list = dictDataService.selectDictDataList(dictData); |
||||
|
return ZDResponse.success("获取字典成功",list); |
||||
|
} |
||||
|
|
||||
|
@RequiresPermissions("system:user:list") |
||||
|
@PostMapping("/listApp") |
||||
|
@ResponseBody |
||||
|
public ZDResponse listApp(@RequestBody User user) { |
||||
|
List<User> list = userService.selectUserList(user); |
||||
|
// 查询出职务
|
||||
|
for (User userData : list) { |
||||
|
List<PostBean> postBeanList = postApi.selectPostsByUserId(userData.getUserId()); |
||||
|
ArrayList<Post> postList = new ArrayList<>(); |
||||
|
|
||||
|
// 职务bean转成实体
|
||||
|
for (PostBean postBean : postBeanList) { |
||||
|
Post post = new Post(); |
||||
|
BeanUtil.copyProperties(postBean, post); |
||||
|
postList.add(post); |
||||
|
} |
||||
|
|
||||
|
if (!postList.isEmpty()) { |
||||
|
userData.setPostList(postList); |
||||
|
} |
||||
|
} |
||||
|
return ZDResponse.success("查询成功",list); |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,47 @@ |
|||||
|
package com.zdxt.app.controller; |
||||
|
|
||||
|
import cn.hutool.core.util.IdUtil; |
||||
|
import com.zdxt.code.utils.IdCardCryptoUtil; |
||||
|
import org.springframework.beans.factory.annotation.Value; |
||||
|
import org.springframework.stereotype.Controller; |
||||
|
import org.springframework.web.bind.annotation.GetMapping; |
||||
|
import org.springframework.web.bind.annotation.RequestMapping; |
||||
|
import org.springframework.web.bind.annotation.ResponseBody; |
||||
|
|
||||
|
import java.util.HashMap; |
||||
|
import java.util.Map; |
||||
|
|
||||
|
@RequestMapping("/app/siq") |
||||
|
@Controller |
||||
|
public class AppTestSIQController { |
||||
|
|
||||
|
@Value("${siq.code}") |
||||
|
private String code; |
||||
|
|
||||
|
@Value("${siq.secretKey}") |
||||
|
private String secretKey; |
||||
|
|
||||
|
@GetMapping("/getToken") |
||||
|
@ResponseBody |
||||
|
public void getToken(String userId,String userName){ |
||||
|
Map<String,Object> heardMap = new HashMap<>(); |
||||
|
Map<String,Object> paramsMap = new HashMap<>(); |
||||
|
try { |
||||
|
//加密后的
|
||||
|
System.out.println(secretKey); |
||||
|
String userIdCode = IdCardCryptoUtil.symmetricEncryptIdCard(secretKey, userId); |
||||
|
String userNameCode = IdCardCryptoUtil.symmetricEncryptIdCard(secretKey, userName); |
||||
|
System.out.println(userIdCode); |
||||
|
System.out.println(userNameCode);; |
||||
|
heardMap.put("x-auth-channel", IdUtil.simpleUUID()); |
||||
|
heardMap.put("x-auth-app-code",code); |
||||
|
// paramsMap.put("userId",userIdCode);
|
||||
|
// paramsMap.put("userName",userNameCode);
|
||||
|
String s = IdCardCryptoUtil.httpSendPost("http://egbpub.siqhz.com/egb/api/thirdauth/pub/auth/token", |
||||
|
userIdCode,userNameCode,code); |
||||
|
System.out.println(s); |
||||
|
} catch (Exception e) { |
||||
|
e.printStackTrace(); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,114 @@ |
|||||
|
package com.zdxt.app.controller; |
||||
|
|
||||
|
import com.alibaba.fastjson.JSONObject; |
||||
|
import com.auth0.jwt.JWTVerifier; |
||||
|
import com.zdxt.auth.feign.UserApi; |
||||
|
import com.zdxt.auth.framework.shiro.jwt.JWTUtils; |
||||
|
import com.zdxt.auth.project.system.user.service.IUserService; |
||||
|
import com.zdxt.code.domain.SiqLogin; |
||||
|
import com.zdxt.code.service.ThirdLoginService; |
||||
|
import com.zdxt.code.utils.HttpUtil; |
||||
|
import com.zdxt.code.utils.IdCardCryptoUtil; |
||||
|
import com.zdxt.common.ZDResponse; |
||||
|
import com.zdxt.domain.auth.User; |
||||
|
import lombok.extern.slf4j.Slf4j; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.beans.factory.annotation.Value; |
||||
|
import org.springframework.stereotype.Controller; |
||||
|
import org.springframework.web.bind.annotation.*; |
||||
|
|
||||
|
import java.util.HashMap; |
||||
|
import java.util.Map; |
||||
|
|
||||
|
/** |
||||
|
* 第三方登录控制层 |
||||
|
*/ |
||||
|
@Slf4j |
||||
|
@Controller |
||||
|
@RequestMapping("/app/thirdLogin") |
||||
|
public class AppThirdLoginController { |
||||
|
|
||||
|
|
||||
|
@Value("${siq.code}") |
||||
|
private String code; |
||||
|
|
||||
|
@Value("${siq.secretKey}") |
||||
|
private String secretKey; |
||||
|
|
||||
|
@Value("${siq.siqUrl}") |
||||
|
private String siqUrl; |
||||
|
|
||||
|
@Autowired |
||||
|
private ThirdLoginService thirdLoginService; |
||||
|
|
||||
|
@Autowired |
||||
|
private UserApi userApi; |
||||
|
/** |
||||
|
* 深i企用户登录 |
||||
|
* @param siqLogin |
||||
|
*/ |
||||
|
@PostMapping("/siqLogin") |
||||
|
@ResponseBody |
||||
|
public ZDResponse siqLogin(@RequestBody SiqLogin siqLogin){ |
||||
|
//敏感信息加密
|
||||
|
String userIdCode = IdCardCryptoUtil.symmetricEncryptIdCard(secretKey, siqLogin.getUserId()); |
||||
|
String userNameCode = IdCardCryptoUtil.symmetricEncryptIdCard(secretKey, siqLogin.getUserName()); |
||||
|
|
||||
|
//获取登录的token
|
||||
|
String token = IdCardCryptoUtil.httpSendPost(siqUrl + "/pub/auth/token", userIdCode, userNameCode, code); |
||||
|
Map<String, String> params = new HashMap<>(); |
||||
|
log.info("获取用户登录令牌:{}",token); |
||||
|
String secret = IdCardCryptoUtil.symmetricEncryptIdCard(secretKey, token); |
||||
|
params.put("accessKeySign",secret); |
||||
|
params.put("appCode",code); |
||||
|
String userInfo = null; |
||||
|
try { |
||||
|
userInfo = HttpUtil.HttpSendPost(siqUrl + "/pub/auth/getUserInfo", params, null, null); |
||||
|
} catch (Exception e) { |
||||
|
e.printStackTrace(); |
||||
|
} |
||||
|
JSONObject jsonObject = JSONObject.parseObject(userInfo); |
||||
|
//添加深i企用户
|
||||
|
thirdLoginService.addSiqUser(jsonObject); |
||||
|
//添加深i企用户关联企业信息
|
||||
|
thirdLoginService.addSiqUserCompany(jsonObject); |
||||
|
return thirdLoginService.siqLogin(jsonObject); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
@Autowired private IUserService iUserService; |
||||
|
|
||||
|
@GetMapping("/doLogin") |
||||
|
@ResponseBody |
||||
|
public Map<String, Object> login(User user){ |
||||
|
Map<String, Object> map = new HashMap<>(); |
||||
|
try{ |
||||
|
User userDB = iUserService.selectUserByLoginName(user.getLoginName()); |
||||
|
Map<String,Object> payload = new HashMap<>(); |
||||
|
payload.put("id", userDB.getUserId()); |
||||
|
payload.put("name", userDB.getLoginName()); |
||||
|
String token = JWTUtils.sign(payload); |
||||
|
map.put("state", true); |
||||
|
map.put("msg", "认证成功"); |
||||
|
map.put("token", token); |
||||
|
}catch (Exception e){ |
||||
|
map.put("state", false); |
||||
|
map.put("msg", e.getMessage()); |
||||
|
} |
||||
|
return map; |
||||
|
|
||||
|
} |
||||
|
@PostMapping("/user/test") |
||||
|
public Map<String,Object> test(String token){ |
||||
|
Map<String, Object> map = new HashMap<>(); |
||||
|
log.info("当前token为:[{}]",token); |
||||
|
|
||||
|
JWTVerifier verify = JWTUtils.verify(token); |
||||
|
map.put("state", true); |
||||
|
map.put("msg", "请求成功"); |
||||
|
|
||||
|
|
||||
|
return map; |
||||
|
|
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,53 @@ |
|||||
|
package com.zdxt.auth.framework.shiro.jwt; |
||||
|
|
||||
|
import com.auth0.jwt.JWTVerifier; |
||||
|
import com.auth0.jwt.exceptions.AlgorithmMismatchException; |
||||
|
import com.auth0.jwt.exceptions.SignatureGenerationException; |
||||
|
import com.auth0.jwt.exceptions.TokenExpiredException; |
||||
|
import com.fasterxml.jackson.databind.ObjectMapper; |
||||
|
import org.springframework.web.servlet.HandlerInterceptor; |
||||
|
|
||||
|
import javax.servlet.http.HttpServletRequest; |
||||
|
import javax.servlet.http.HttpServletResponse; |
||||
|
import java.util.HashMap; |
||||
|
import java.util.Map; |
||||
|
|
||||
|
/** |
||||
|
* @Author: kylin |
||||
|
* @Date: 2024/4/30 11:37 下午 |
||||
|
* @Version: 1.0 |
||||
|
* @Desc: TODO |
||||
|
*/ |
||||
|
public class JWTInterceptor implements HandlerInterceptor { |
||||
|
|
||||
|
@Override |
||||
|
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception { |
||||
|
String token = request.getHeader("token"); |
||||
|
Map<String, Object> map = new HashMap<>(); |
||||
|
|
||||
|
try { |
||||
|
JWTVerifier verify = JWTUtils.verify(token); |
||||
|
map.put("state", true); |
||||
|
map.put("msg", "请求成功"); |
||||
|
}catch (SignatureGenerationException e){ |
||||
|
e.printStackTrace(); |
||||
|
map.put("msg","无效签名"); |
||||
|
}catch (TokenExpiredException e){ |
||||
|
e.printStackTrace(); |
||||
|
map.put("msg","token过期"); |
||||
|
}catch (AlgorithmMismatchException e){ |
||||
|
e.printStackTrace(); |
||||
|
map.put("msg","token算法不一致"); |
||||
|
} |
||||
|
catch (Exception e) { |
||||
|
e.printStackTrace(); |
||||
|
map.put("msg","token无效"); |
||||
|
} |
||||
|
map.put("state", false); // 设置状态
|
||||
|
// 将map转为json
|
||||
|
String json = new ObjectMapper().writeValueAsString(map); |
||||
|
response.setContentType("application/json;charset=UTF-8"); |
||||
|
response.getWriter().println(json); |
||||
|
return false; |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,171 @@ |
|||||
|
package com.zdxt.auth.framework.shiro.jwt; |
||||
|
|
||||
|
/** |
||||
|
* @ClassName JwtUtil |
||||
|
* @Description TODO |
||||
|
* @Author Administrator |
||||
|
* @Date 2021/02/01 15:04:33 |
||||
|
* @Verison 1.0 |
||||
|
*/ |
||||
|
import com.auth0.jwt.JWT; |
||||
|
import com.auth0.jwt.JWTCreator; |
||||
|
import com.auth0.jwt.JWTVerifier; |
||||
|
import com.auth0.jwt.algorithms.Algorithm; |
||||
|
import com.auth0.jwt.exceptions.TokenExpiredException; |
||||
|
import com.auth0.jwt.interfaces.Claim; |
||||
|
import org.apache.commons.lang3.StringUtils; |
||||
|
|
||||
|
import java.util.Base64; |
||||
|
import java.util.Date; |
||||
|
import java.util.HashMap; |
||||
|
import java.util.Map; |
||||
|
|
||||
|
|
||||
|
public class JWTUtils { |
||||
|
//过期时间 3天
|
||||
|
private static final long EXPIRE_TIME = 3 * 24 * 60 * 60 * 1000; |
||||
|
//私钥
|
||||
|
private static final String TOKEN_SECRET = "huiming@7122^$"; |
||||
|
|
||||
|
/** |
||||
|
* 生成签名,15分钟过期 |
||||
|
* 根据内部改造,支持6中类型,Integer,Long,Boolean,Double,String,Date |
||||
|
* @param map |
||||
|
* @return |
||||
|
*/ |
||||
|
public static String sign(Map<String,Object> map) { |
||||
|
try { |
||||
|
// 设置过期时间
|
||||
|
Date date = new Date(System.currentTimeMillis() + EXPIRE_TIME); |
||||
|
// 私钥和加密算法
|
||||
|
Algorithm algorithm = Algorithm.HMAC256(TOKEN_SECRET); |
||||
|
// 设置头部信息
|
||||
|
Map<String, Object> header = new HashMap<>(2); |
||||
|
header.put("typ", "jwt"); |
||||
|
// 返回token字符串
|
||||
|
JWTCreator.Builder builder = JWT.create() |
||||
|
.withHeader(header) |
||||
|
.withIssuedAt(new Date()) //发证时间
|
||||
|
.withExpiresAt(date); //过期时间
|
||||
|
// .sign(algorithm); //密钥
|
||||
|
|
||||
|
map.entrySet().forEach(entry -> { |
||||
|
if (entry.getValue() instanceof Integer) { |
||||
|
builder.withClaim( entry.getKey(),(Integer)entry.getValue()); |
||||
|
} else if (entry.getValue() instanceof Long) { |
||||
|
builder.withClaim( entry.getKey(),(Long)entry.getValue()); |
||||
|
} else if (entry.getValue() instanceof Boolean) { |
||||
|
|
||||
|
builder.withClaim( entry.getKey(),(Boolean) entry.getValue()); |
||||
|
} else if (entry.getValue() instanceof String) { |
||||
|
builder.withClaim( entry.getKey(),String.valueOf(entry.getValue())); |
||||
|
} else if (entry.getValue() instanceof Double) { |
||||
|
builder.withClaim( entry.getKey(),(Double)entry.getValue()); |
||||
|
} else if (entry.getValue() instanceof Date) { |
||||
|
builder.withClaim( entry.getKey(),(Date)entry.getValue()); |
||||
|
} |
||||
|
}); |
||||
|
return builder.sign(algorithm); |
||||
|
} catch (Exception e) { |
||||
|
e.printStackTrace(); |
||||
|
return null; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 检验token是否正确 |
||||
|
* @param **token** |
||||
|
* @return |
||||
|
*/ |
||||
|
public static JWTVerifier verify(String token){ |
||||
|
|
||||
|
Algorithm algorithm = Algorithm.HMAC256(TOKEN_SECRET); |
||||
|
JWTVerifier verifier = JWT.require(algorithm).build(); |
||||
|
verifier.verify(token); |
||||
|
return verifier; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
*获取用户自定义Claim集合 |
||||
|
* @param token |
||||
|
* @return |
||||
|
*/ |
||||
|
public static Map<String, Claim> getClaims(String token){ |
||||
|
Algorithm algorithm = Algorithm.HMAC256(TOKEN_SECRET); |
||||
|
JWTVerifier verifier = JWT.require(algorithm).build(); |
||||
|
Map<String, Claim> jwt = verifier.verify(token).getClaims(); |
||||
|
return jwt; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 获取过期时间 |
||||
|
* @param token |
||||
|
* @return |
||||
|
*/ |
||||
|
public static Date getExpiresAt(String token){ |
||||
|
Algorithm algorithm = Algorithm.HMAC256(TOKEN_SECRET); |
||||
|
return JWT.require(algorithm).build().verify(token).getExpiresAt(); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 获取jwt发布时间 |
||||
|
*/ |
||||
|
public static Date getIssuedAt(String token){ |
||||
|
Algorithm algorithm = Algorithm.HMAC256(TOKEN_SECRET); |
||||
|
return JWT.require(algorithm).build().verify(token).getIssuedAt(); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 验证token是否失效 |
||||
|
* |
||||
|
* @param token |
||||
|
* @return true:过期 false:没过期 |
||||
|
*/ |
||||
|
public static boolean isExpired(String token) { |
||||
|
try { |
||||
|
final Date expiration = getExpiresAt(token); |
||||
|
return expiration.before(new Date()); |
||||
|
}catch (TokenExpiredException e) { |
||||
|
// e.printStackTrace();
|
||||
|
return true; |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 直接Base64解密获取header内容 |
||||
|
* @param token |
||||
|
* @return |
||||
|
*/ |
||||
|
public static String getHeaderByBase64(String token){ |
||||
|
if (StringUtils.isEmpty(token)){ |
||||
|
return null; |
||||
|
}else { |
||||
|
byte[] header_byte = Base64.getDecoder().decode(token.split("\\.")[0]); |
||||
|
String header = new String(header_byte); |
||||
|
return header; |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 直接Base64解密获取payload内容 |
||||
|
* @param token |
||||
|
* @return |
||||
|
*/ |
||||
|
public static String getPayloadByBase64(String token){ |
||||
|
|
||||
|
if (StringUtils.isEmpty(token)){ |
||||
|
return null; |
||||
|
}else { |
||||
|
byte[] payload_byte = Base64.getDecoder().decode(token.split("\\.")[1]); |
||||
|
String payload = new String(payload_byte); |
||||
|
return payload; |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
|
||||
|
|
||||
|
} |
||||
|
|
||||
Loading…
Reference in new issue