Commit 225c1615 authored by mx's avatar mx

通道

parent 07196b7d
......@@ -2,6 +2,7 @@ package org.rcisoft.sys.doordeviceinfo.controller;
/*固定导入*/
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
......@@ -20,6 +21,7 @@ import org.rcisoft.core.controller.CyPaginationController;
import org.rcisoft.core.util.CyUserUtil;
import org.rcisoft.core.model.CyGridModel;
import org.rcisoft.core.exception.CyServiceException;
import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;
......@@ -30,8 +32,8 @@ import org.rcisoft.sys.doordeviceinfo.service.DoorDeviceInfoService;
import java.util.List;
/**
* Created by cy on 2022年12月23日 下午2:04:50.
*/
* Created by cy on 2022年12月23日 下午2:04:50.
*/
@RestController
@RequestMapping("/doordeviceinfo")
public class DoorDeviceInfoController extends CyPaginationController<DoorDeviceInfo> {
......@@ -42,69 +44,70 @@ public class DoorDeviceInfoController extends CyPaginationController<DoorDeviceI
//@PreAuthorize("@cyPerm.hasPerm('sys:rDeviceInfo:add')")
@CyOpeLogAnno(title = "system-门磁设备记录表管理-新增门磁设备记录表", businessType = CyLogTypeEnum.INSERT)
@ApiOperation(value="添加门磁设备记录表", notes="添加门磁设备记录表")
@ApiOperation(value = "添加门磁设备记录表", notes = "添加门磁设备记录表")
@PostMapping(value = "/add")
public CyResult add(@Valid DoorDeviceInfo doorDeviceInfo, BindingResult bindingResult) {
CyPersistModel data = doorDeviceInfoServiceImpl.persist(doorDeviceInfo);
return CyResultGenUtil.builder(data,
CyMessCons.MESSAGE_ALERT_SUCCESS,
CyMessCons.MESSAGE_ALERT_ERROR,
doorDeviceInfo);
CyMessCons.MESSAGE_ALERT_SUCCESS,
CyMessCons.MESSAGE_ALERT_ERROR,
doorDeviceInfo);
}
//@PreAuthorize("@cyPerm.hasPerm('sys:rDeviceInfo:delete')")
@CyOpeLogAnno(title = "system-门磁设备记录表管理-删除门磁设备记录表", businessType = CyLogTypeEnum.DELETE)
@ApiOperation(value="删除门磁设备记录表", notes="删除门磁设备记录表")
@ApiOperation(value = "删除门磁设备记录表", notes = "删除门磁设备记录表")
@ApiImplicitParams({@ApiImplicitParam(name = "businessId", value = "businessId", required = true, dataType = "varchar")})
@DeleteMapping("/delete/{businessId:\\w+}")
public CyResult delete(@PathVariable int businessId,DoorDeviceInfo doorDeviceInfo) {
public CyResult delete(@PathVariable int businessId, DoorDeviceInfo doorDeviceInfo) {
doorDeviceInfo.setBusinessId(businessId);
CyPersistModel data = doorDeviceInfoServiceImpl.remove(doorDeviceInfo);
return CyResultGenUtil.builder(data,
CyMessCons.MESSAGE_ALERT_SUCCESS,
CyMessCons.MESSAGE_ALERT_ERROR,
businessId);
CyMessCons.MESSAGE_ALERT_SUCCESS,
CyMessCons.MESSAGE_ALERT_ERROR,
businessId);
}
//@PreAuthorize("@cyPerm.hasPerm('sys:rDeviceInfo:update')")
@CyOpeLogAnno(title = "system-门磁设备记录表管理-修改门磁设备记录表", businessType = CyLogTypeEnum.UPDATE)
@ApiOperation(value="修改门磁设备记录表", notes="修改门磁设备记录表")
@ApiOperation(value = "修改门磁设备记录表", notes = "修改门磁设备记录表")
@ApiImplicitParams({@ApiImplicitParam(name = "businessId", value = "businessId", required = false, dataType = "varchar")})
@PutMapping("/update/{businessId:\\w+}")
public CyResult update(@PathVariable int businessId, @Valid DoorDeviceInfo doorDeviceInfo, BindingResult bindingResult) {
doorDeviceInfo.setBusinessId(businessId);
@PutMapping("/update")
public CyResult update(@RequestBody DoorDeviceInfo doorDeviceInfo, BindingResult bindingResult) {
// doorDeviceInfo.setBusinessId(businessId);
CyPersistModel data = doorDeviceInfoServiceImpl.merge(doorDeviceInfo);
return CyResultGenUtil.builder(data,
CyMessCons.MESSAGE_ALERT_SUCCESS,
CyMessCons.MESSAGE_ALERT_ERROR,
doorDeviceInfo);
CyMessCons.MESSAGE_ALERT_SUCCESS,
CyMessCons.MESSAGE_ALERT_ERROR,
doorDeviceInfo);
}
//@PreAuthorize("@cyPerm.hasPerm('sys:rDeviceInfo:query')")
@CyOpeLogAnno(title = "system-门磁设备记录表管理-查询门磁设备记录表", businessType = CyLogTypeEnum.QUERY)
@ApiOperation(value="查询单一门磁设备记录表", notes="查询单一门磁设备记录表")
@ApiOperation(value = "查询单一门磁设备记录表", notes = "查询单一门磁设备记录表")
@ApiImplicitParams({@ApiImplicitParam(name = "businessId", value = "businessId", required = true, dataType = "varchar")})
@GetMapping("/detail/{businessId:\\w+}")
public CyResult detail(@PathVariable int businessId) {
return CyResultGenUtil.builder(new CyPersistModel(1),
CyMessCons.MESSAGE_ALERT_SUCCESS,
CyMessCons.MESSAGE_ALERT_ERROR,
doorDeviceInfoServiceImpl.findById(businessId));
CyMessCons.MESSAGE_ALERT_SUCCESS,
CyMessCons.MESSAGE_ALERT_ERROR,
doorDeviceInfoServiceImpl.findById(businessId));
}
//@PreAuthorize("@cyPerm.hasPerm('sys:rDeviceInfo:list')")
@CyOpeLogAnno(title = "system-门磁设备记录表管理-查询门磁设备记录表", businessType = CyLogTypeEnum.QUERY)
@ApiOperation(value="查询门磁设备记录表集合", notes="查询门磁设备记录表集合")
@ApiOperation(value = "查询门磁设备记录表集合", notes = "查询门磁设备记录表集合")
@GetMapping(value = "/queryDoorDeviceInfos")
public CyResult queryDoorDeviceInfos(DoorDeviceInfo doorDeviceInfo) {
return CyResultGenUtil.builder(new CyPersistModel(1),
CyMessCons.MESSAGE_ALERT_SUCCESS,
CyMessCons.MESSAGE_ALERT_ERROR,
doorDeviceInfoServiceImpl.findAll(doorDeviceInfo));
CyMessCons.MESSAGE_ALERT_SUCCESS,
CyMessCons.MESSAGE_ALERT_ERROR,
doorDeviceInfoServiceImpl.findAll(doorDeviceInfo));
}
//@PreAuthorize("@cyPerm.hasPerm('sys:rDeviceInfo:list')")
@CyOpeLogAnno(title = "system-门磁设备记录表管理-查询门磁设备记录表", businessType = CyLogTypeEnum.QUERY)
@ApiOperation(value="分页查询门磁设备记录表集合", notes="分页查询门磁设备记录表集合")
@ApiOperation(value = "分页查询门磁设备记录表集合", notes = "分页查询门磁设备记录表集合")
@GetMapping(value = "/queryDoorDeviceInfoByPagination")
public CyGridModel listByPagination(DoorDeviceInfo doorDeviceInfo) {
doorDeviceInfoServiceImpl.findAllByPagination(getPaginationUtility(), doorDeviceInfo);
......@@ -114,18 +117,24 @@ public class DoorDeviceInfoController extends CyPaginationController<DoorDeviceI
@CyOpeLogAnno(title = "system-门磁设备记录表管理-查询门磁设备记录表", businessType = CyLogTypeEnum.EXPORT)
@ApiOperation(value = "导出门磁设备记录表信息", notes = "导出门磁设备记录表信息")
@GetMapping(value = "/export")
public CyResult outDoorDeviceInfo(HttpServletResponse response,DoorDeviceInfo doorDeviceInfo,@PathVariable @RequestParam(defaultValue = "0") String excelId) {
String excelName="";
switch(excelId){
case "0": excelName="门磁设备记录表信息.xls";break;
case "1": excelName="门磁设备记录表信息.xlsx";break;
case "2": excelName="门磁设备记录表信息.csv";break;
public CyResult outDoorDeviceInfo(HttpServletResponse response, DoorDeviceInfo doorDeviceInfo, @PathVariable @RequestParam(defaultValue = "0") String excelId) {
String excelName = "";
switch (excelId) {
case "0":
excelName = "门磁设备记录表信息.xls";
break;
case "1":
excelName = "门磁设备记录表信息.xlsx";
break;
case "2":
excelName = "门磁设备记录表信息.csv";
break;
}
List<DoorDeviceInfo> doorDeviceInfoList = doorDeviceInfoServiceImpl.export(doorDeviceInfo);
CyEpExcelUtil.exportExcel(doorDeviceInfoList, "门磁设备记录表信息", "门磁设备记录表信息", DoorDeviceInfo.class, excelName, response);
return CyResultGenUtil.builder(new CyPersistModel(1),
CyMessCons.MESSAGE_ALERT_SUCCESS,
CyMessCons.MESSAGE_ALERT_ERROR,
doorDeviceInfoList);
CyMessCons.MESSAGE_ALERT_SUCCESS,
CyMessCons.MESSAGE_ALERT_ERROR,
doorDeviceInfoList);
}
}
......@@ -27,5 +27,7 @@ public interface DoorDeviceInfoRepository extends CyBaseMapper<DoorDeviceInfo> {
IPage<DoorDeviceInfo> queryDoorDeviceInfosPaged(CyPageInfo cyPageInfo, @Param("entity") DoorDeviceInfo doorDeviceInfo);
DoorDeviceInfo queryDoorDeviceInfosById(Integer business_id);
public int updateDoorDeviceInfos(@Param("entity") DoorDeviceInfo doorDeviceInfo);
}
......@@ -25,6 +25,7 @@ public class DoorDeviceInfo extends CyIdIncreEntity<DoorDeviceInfo> {
@Transient
private String px;
@Transient
//标记异常(0 异常 1非异常)
private String abnormal;
......
......@@ -75,7 +75,7 @@ public class DoorDeviceInfoServiceImpl extends ServiceImpl<DoorDeviceInfoReposit
@Transactional(propagation = Propagation.REQUIRED, isolation = Isolation.DEFAULT)
@Override
public CyPersistModel merge(DoorDeviceInfo doorDeviceInfo) {
int line = baseMapper.updateById(doorDeviceInfo);
int line = doorDeviceInfoRepository.updateDoorDeviceInfos(doorDeviceInfo);
log.debug(CyUserUtil.getAuthenUsername() + "修改了ID为" + doorDeviceInfo.getBusinessId() + "的门磁设备记录表信息");
return new CyPersistModel(line);
}
......
......@@ -59,4 +59,13 @@
WHERE ddi.del_flag = 0
AND drd.business_id = #{id}
</select>
<update id="updateDoorDeviceInfos" parameterType="org.rcisoft.sys.doordeviceinfo.entity.DoorDeviceInfo">
update door_report_data
<trim prefix="SET" suffixOverrides=",">
<if test="entity.abnormal != null">abnormal = #{entity.abnormal},</if>
</trim>
where business_id = #{entity.businessId}
</update>
</mapper>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment