|
|
|
@ -1,9 +1,14 @@ |
|
|
|
package com.zdxt.code.controller; |
|
|
|
|
|
|
|
import java.util.HashMap; |
|
|
|
import java.util.List; |
|
|
|
import java.util.Map; |
|
|
|
|
|
|
|
import com.zdxt.code.domain.LinkageDict; |
|
|
|
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; |
|
|
|
@ -27,6 +32,7 @@ public class EnterpriseLawEnforcementController extends BaseController |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private IEnterpriseLawEnforcementService enterpriseLawEnforcementService; |
|
|
|
@Autowired private ILinkageDictService iLinkageDictService; |
|
|
|
|
|
|
|
@RequiresPermissions("code:enforcement:view") |
|
|
|
@GetMapping() |
|
|
|
@ -79,8 +85,16 @@ public class EnterpriseLawEnforcementController extends BaseController |
|
|
|
@ResponseBody |
|
|
|
public ZDResponse addSave(@RequestBody EnterpriseLawEnforcement enterpriseLawEnforcement) |
|
|
|
{ |
|
|
|
return enterpriseLawEnforcementService.insertEnterpriseLawEnforcement(enterpriseLawEnforcement) > 0 ? |
|
|
|
ZDResponse.success("预约成功") : ZDResponse.error("预约失败"); |
|
|
|
// 先通过用户ID 加 状态0 判断是否已经有暂存的数据了 . 有的话就更新, 没有再新增
|
|
|
|
EnterpriseLawEnforcement keyObj = enterpriseLawEnforcementService.getByUserIdAndZero(); |
|
|
|
int resNum = 0; |
|
|
|
if (null!=keyObj && StringUtils.isNotEmpty(keyObj.getId())) { |
|
|
|
resNum = enterpriseLawEnforcementService.updateEnterpriseLawEnforcement(enterpriseLawEnforcement); |
|
|
|
} else { |
|
|
|
resNum = enterpriseLawEnforcementService.insertEnterpriseLawEnforcement(enterpriseLawEnforcement); |
|
|
|
} |
|
|
|
|
|
|
|
return resNum > 0 ? ZDResponse.success("预约成功") : ZDResponse.error("预约失败"); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
@ -141,4 +155,21 @@ public ZDResponse getById(@PathVariable("id") String id) |
|
|
|
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); |
|
|
|
} |
|
|
|
} |
|
|
|
|