| | |
| | | @ApiOperationSupport(order = 4) |
| | | @ApiOperation(value = "新增", notes = "传入permit") |
| | | public R save(@Valid @RequestBody Permit permit) { |
| | | String cardid = permit.getCardid(); |
| | | Map map = permitService.selectIn(cardid); |
| | | if (map!=null){ |
| | | String id = map.get("id").toString(); |
| | | permitService.removeByIds(Func.toLongList(id)); |
| | | } |
| | | permit.setType("2"); |
| | | permit.setStorage("1"); |
| | | permit.setPermitime(new Date()); |
| | |
| | | @PostMapping("/storage") |
| | | @ApiOperation(value = "新增", notes = "传入permit") |
| | | public R storage(@Valid @RequestBody Permit permit) { |
| | | String cardid = permit.getCardid(); |
| | | Map map = permitService.selectIn(cardid); |
| | | if (map!=null){ |
| | | permitService.updateById(permit); |
| | | } |
| | | permit.setStorage("0"); |
| | | permit.setPermitime(new Date()); |
| | | return R.status(permitService.save(permit)); |
| | |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.validation.Valid; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 控制器 |
| | |
| | | @ApiOperationSupport(order = 4) |
| | | @ApiOperation(value = "新增", notes = "传入record") |
| | | public R save(@Valid @RequestBody Record record) { |
| | | String cardid = record.getCardid(); |
| | | Map map = recordService.selectIn(cardid); |
| | | if (map!=null){ |
| | | String id = map.get("id").toString(); |
| | | recordService.removeByIds(Func.toLongList(id)); |
| | | } |
| | | record.setStorage("0"); |
| | | return R.status(recordService.save(record)); |
| | | } |
| | | |
| | | /** |
| | | * 暂存 |
| | | */ |
| | | @PostMapping("/rocordsave") |
| | | @ApiOperationSupport(order = 4) |
| | | @ApiOperation(value = "新增", notes = "传入record") |
| | | public R rocordsave(@Valid @RequestBody Record record) { |
| | | String cardid = record.getCardid(); |
| | | Map map = recordService.selectIn(cardid); |
| | | if (map!=null){ |
| | | recordService.updateById(record); |
| | | } |
| | | record.setType("2"); |
| | | record.setPtype("2"); |
| | | return R.status(recordService.save(record)); |
| | |
| | | private String representativecell; |
| | | private String contacts; |
| | | private String contactscell; |
| | | private String storage; |
| | | |
| | | |
| | | } |
| | |
| | | import org.springblade.modules.record.vo.RecordVO; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * Mapper 接口 |
| | |
| | | * @return |
| | | */ |
| | | List<RecordVO> selectRecordPage(IPage page, RecordVO record); |
| | | |
| | | Map selectIn(String cardid); |
| | | } |
| | |
| | | <result column="representativecell" property="representativecell"/> |
| | | <result column="contacts" property="contacts"/> |
| | | <result column="contactscell" property="contactscell"/> |
| | | <result column="storage" property="storage"/> |
| | | </resultMap> |
| | | |
| | | |
| | |
| | | select * from sys_record |
| | | </select> |
| | | |
| | | <select id="selectIn" resultType="java.util.HashMap"> |
| | | select * from sys_record where storage=0 and cardid=#{cardid} |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | import org.springblade.modules.record.entity.Record; |
| | | import org.springblade.modules.record.vo.RecordVO; |
| | | |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 服务类 |
| | | * |
| | |
| | | * @return |
| | | */ |
| | | IPage<RecordVO> selectRecordPage(IPage<RecordVO> page, RecordVO record); |
| | | |
| | | Map selectIn(String cardid); |
| | | } |
| | |
| | | import org.springblade.modules.record.vo.RecordVO; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 服务实现类 |
| | | * |
| | |
| | | return page.setRecords(baseMapper.selectRecordPage(page, record)); |
| | | } |
| | | |
| | | @Override |
| | | public Map selectIn(String cardid) { |
| | | return baseMapper.selectIn(cardid); |
| | | } |
| | | |
| | | } |
| | |
| | | import org.springblade.core.mp.support.Query; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springblade.core.tool.utils.Func; |
| | | import org.springblade.modules.permit.entity.Permit; |
| | | import org.springblade.modules.recordk.entity.Recordk; |
| | | import org.springblade.modules.recordk.service.IRecordkService; |
| | | import org.springblade.modules.recordk.vo.RecordkVO; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.validation.Valid; |
| | | import java.util.Date; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 控制器 |
| | |
| | | @ApiOperationSupport(order = 4) |
| | | @ApiOperation(value = "新增", notes = "传入recordk") |
| | | public R save(@Valid @RequestBody Recordk recordk) { |
| | | String cardid = recordk.getCardid(); |
| | | Map map = recordkService.selectIn(cardid); |
| | | if (map!=null){ |
| | | String id = map.get("id").toString(); |
| | | recordkService.removeByIds(Func.toLongList(id)); |
| | | } |
| | | recordk.setType("2"); |
| | | recordk.setPtype("3"); |
| | | return R.status(recordkService.save(recordk)); |
| | | } |
| | | |
| | | /** |
| | | *暂存 |
| | | */ |
| | | @PostMapping("/recorkstorage") |
| | | @ApiOperation(value = "新增", notes = "传入permit") |
| | | public R recorkstorage(@Valid @RequestBody Recordk recordk) { |
| | | String cardid = recordk.getCardid(); |
| | | Map map = recordkService.selectIn(cardid); |
| | | if (map!=null){ |
| | | recordkService.updateById(recordk); |
| | | } |
| | | recordk.setStorage("0"); |
| | | recordk.setPermitime(new Date()); |
| | | return R.status(recordkService.save(recordk)); |
| | | } |
| | | |
| | | /** |
| | | * 修改 |
| | | */ |
| | | @PostMapping("/update") |
| | |
| | | private String representativecell; |
| | | private String contacts; |
| | | private String contactscell; |
| | | private String storage; |
| | | |
| | | |
| | | } |
| | |
| | | import org.springblade.modules.recordk.vo.RecordkVO; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * Mapper 接口 |
| | |
| | | * @return |
| | | */ |
| | | List<RecordkVO> selectRecordkPage(IPage page, RecordkVO recordk); |
| | | |
| | | Map selectIn(String cardid); |
| | | } |
| | |
| | | <result column="representativecell" property="representativecell"/> |
| | | <result column="contacts" property="contacts"/> |
| | | <result column="contactscell" property="contactscell"/> |
| | | <result column="storage" property="storage"/> |
| | | </resultMap> |
| | | |
| | | |
| | |
| | | select * from sys_recordk |
| | | </select> |
| | | |
| | | <select id="selectIn" resultType="java.util.HashMap"> |
| | | select * from sys_recordk where storage=0 and cardid=#{cardid} |
| | | </select> |
| | | </mapper> |
| | |
| | | import org.springblade.modules.recordk.entity.Recordk; |
| | | import org.springblade.modules.recordk.vo.RecordkVO; |
| | | |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 服务类 |
| | | * |
| | |
| | | * @return |
| | | */ |
| | | IPage<RecordkVO> selectRecordkPage(IPage<RecordkVO> page, RecordkVO recordk); |
| | | |
| | | Map selectIn(String cardid); |
| | | } |
| | |
| | | import org.springblade.modules.recordk.vo.RecordkVO; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 服务实现类 |
| | | * |
| | |
| | | return page.setRecords(baseMapper.selectRecordkPage(page, recordk)); |
| | | } |
| | | |
| | | @Override |
| | | public Map selectIn(String cardid) { |
| | | return baseMapper.selectIn(cardid); |
| | | } |
| | | |
| | | } |
| | |
| | | @GetMapping("/list") |
| | | @ApiOperationSupport(order = 2) |
| | | @ApiOperation(value = "分页", notes = "传入attach") |
| | | public R<IPage<Attach>> list(Attach attach, Query query, String deptid, String type) { |
| | | public R<IPage<Attach>> list(Attach attach, Query query, String deptid, String type,String cardid) { |
| | | attach.setDeptid(deptid); |
| | | attach.setType(type); |
| | | attach.setCardid(cardid); |
| | | IPage<Attach> pages = attachService.page(Condition.getPage(query), Condition.getQueryWrapper(attach)); |
| | | return R.data(pages); |
| | | } |
| | |
| | | */ |
| | | @SneakyThrows |
| | | @PostMapping("/put-file-attach") |
| | | public R<BladeFile> putFileAttach(@RequestParam MultipartFile file,String deptid,String type,Long noticeId) { |
| | | public R<BladeFile> putFileAttach(@RequestParam MultipartFile file,String deptid,String type,Long noticeId,String cardid) { |
| | | String fileName = file.getOriginalFilename(); |
| | | BladeFile bladeFile = ossBuilder.template().putFile(fileName, file.getInputStream()); |
| | | Long attachId = buildAttach(fileName, file.getSize(), bladeFile,deptid,type,noticeId); |
| | | Long attachId = buildAttach(fileName, file.getSize(), bladeFile,deptid,type,noticeId,cardid); |
| | | bladeFile.setAttachId(attachId); |
| | | return R.data(bladeFile); |
| | | } |
| | |
| | | */ |
| | | @SneakyThrows |
| | | @PostMapping("/put-file-attach-by-name") |
| | | public R<BladeFile> putFileAttach(@RequestParam String fileName, @RequestParam MultipartFile file,String deptid,String type,Long noticeId) { |
| | | public R<BladeFile> putFileAttach(@RequestParam String fileName, @RequestParam MultipartFile file,String deptid,String type,Long noticeId,String cardid) { |
| | | BladeFile bladeFile = ossBuilder.template().putFile(fileName, file.getInputStream()); |
| | | Long attachId = buildAttach(fileName, file.getSize(), bladeFile,deptid,type,noticeId); |
| | | Long attachId = buildAttach(fileName, file.getSize(), bladeFile,deptid,type,noticeId,cardid); |
| | | bladeFile.setAttachId(attachId); |
| | | return R.data(bladeFile); |
| | | } |
| | |
| | | * @param bladeFile 对象存储文件 |
| | | * @return attachId |
| | | */ |
| | | private Long buildAttach(String fileName, Long fileSize, BladeFile bladeFile,String deptid,String type,Long noticeId) throws Exception { |
| | | private Long buildAttach(String fileName, Long fileSize, BladeFile bladeFile,String deptid,String type,Long noticeId,String cardid) throws Exception { |
| | | //BladeUser user = AuthUtil.getUser(); |
| | | String fileExtension = FileUtil.getFileExtension(fileName); |
| | | Attach attach = new Attach(); |
| | |
| | | attach.setAttachSize(fileSize); |
| | | attach.setExtension(fileExtension); |
| | | attach.setDeptid(deptid); |
| | | attach.setCardid(cardid); |
| | | attach.setType(type); |
| | | if (null!=noticeId){ |
| | | attach.setNoticeId(noticeId); |
| | |
| | | */ |
| | | @TableField("notice_id") |
| | | private Long noticeId; |
| | | private String cardid; |
| | | |
| | | |
| | | } |
| | |
| | | |
| | | import javax.validation.Valid; |
| | | import java.util.Date; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 控制器 |
| | |
| | | @ApiOperationSupport(order = 4) |
| | | @ApiOperation(value = "新增", notes = "传入revoke") |
| | | public R save(@Valid @RequestBody Revoke revoke) { |
| | | String cardid = revoke.getCardid(); |
| | | Map map = revokeService.selectIn(cardid); |
| | | if (map!=null){ |
| | | String id = map.get("id").toString(); |
| | | revokeService.removeByIds(Func.toLongList(id)); |
| | | } |
| | | revoke.setType("2"); |
| | | revoke.setPtype("4"); |
| | | revoke.setPermitime(new Date()); |
| | | return R.status(revokeService.save(revoke)); |
| | | } |
| | | |
| | | /** |
| | | *暂存 |
| | | */ |
| | | @PostMapping("/revokesave") |
| | | @ApiOperationSupport(order = 4) |
| | | @ApiOperation(value = "新增", notes = "传入revoke") |
| | | public R revokesave(@Valid @RequestBody Revoke revoke) { |
| | | String cardid = revoke.getCardid(); |
| | | Map map = revokeService.selectIn(cardid); |
| | | if (map!=null){ |
| | | revokeService.updateById(revoke); |
| | | } |
| | | revoke.setType("2"); |
| | | revoke.setPtype("4"); |
| | | revoke.setPermitime(new Date()); |
| | |
| | | private String representativecell; |
| | | private String contacts; |
| | | private String contactscell; |
| | | private String storage; |
| | | |
| | | } |
| | |
| | | import org.springblade.modules.revoke.vo.RevokeVO; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * Mapper 接口 |
| | |
| | | * @return |
| | | */ |
| | | List<RevokeVO> selectRevokePage(IPage page, RevokeVO revoke); |
| | | |
| | | Map selectIn(String cardid); |
| | | } |
| | |
| | | <result column="representativecell" property="representativecell"/> |
| | | <result column="contacts" property="contacts"/> |
| | | <result column="contactscell" property="contactscell"/> |
| | | <result column="storage" property="storage"/> |
| | | </resultMap> |
| | | |
| | | |
| | | <select id="selectRevokePage" resultMap="revokeResultMap"> |
| | | select * from sys_revoke |
| | | </select> |
| | | |
| | | <select id="selectIn" resultType="java.util.HashMap"> |
| | | select * from sys_revoke where storage=0 and cardid=#{cardid} |
| | | </select> |
| | | </mapper> |
| | |
| | | import org.springblade.modules.revoke.entity.Revoke; |
| | | import org.springblade.modules.revoke.vo.RevokeVO; |
| | | |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 服务类 |
| | | * |
| | |
| | | * @return |
| | | */ |
| | | IPage<RevokeVO> selectRevokePage(IPage<RevokeVO> page, RevokeVO revoke); |
| | | |
| | | Map selectIn(String cardid); |
| | | } |
| | |
| | | import org.springblade.modules.revoke.vo.RevokeVO; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 服务实现类 |
| | | * |
| | |
| | | return page.setRecords(baseMapper.selectRevokePage(page, revoke)); |
| | | } |
| | | |
| | | @Override |
| | | public Map selectIn(String cardid) { |
| | | return baseMapper.selectIn(cardid); |
| | | } |
| | | |
| | | } |