| | |
| | | import org.springblade.modules.licence.entity.LicencePaper; |
| | | import org.springblade.modules.licence.service.LicencePaperService; |
| | | import org.springblade.modules.licence.vo.LicencePaperVo; |
| | | import org.springblade.modules.system.service.MyAsyncService; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | |
| | | |
| | | private final LicencePaperService licencePaperService; |
| | | |
| | | |
| | | private final MyAsyncService myAsyncService; |
| | | |
| | | // /** |
| | | // * 自定义分页 |
| | |
| | | if (null==licencePaper.getId()){ |
| | | licencePaper.setCreateTime(new Date()); |
| | | licencePaper.setUpdateTime(new Date()); |
| | | licencePaperService.save(licencePaper); |
| | | boolean save = licencePaperService.save(licencePaper); |
| | | //数据同步 |
| | | if (save){ |
| | | String s = "insert into sys_licence_paper" + |
| | | "(id,type,unit_name,address,legal_people,content,approval_number,licence_issuing_unit,register_capital," + |
| | | "code,licence_issuing_time,create_user,create_time,update_user,update_time,dept_id,url) " + |
| | | "values(" + "'" + licencePaper.getId() + "'" + |
| | | "," + "'" + licencePaper.getType() + "'" + |
| | | "," + "'" + licencePaper.getUnitName() + "'" + |
| | | "," + "'" + licencePaper.getAddress() + "'" + |
| | | "," + "'" + licencePaper.getLegalPeople() + "'" + |
| | | "," + "'" + licencePaper.getContent() + "'" + |
| | | "," + "'" + licencePaper.getApprovalNumber() + "'" + |
| | | "," + "'" + licencePaper.getLicenceIssuingUnit() + "'" + |
| | | "," + "'" + licencePaper.getRegisterCapital() + "'" + |
| | | "," + "'" + licencePaper.getCode() + "'" + |
| | | "," + "'" + new SimpleDateFormat("yyyy-MM-dd").format(licencePaper.getLicenceIssuingTime()) + "'" + |
| | | "," + "'" + licencePaper.getCreateUser() + "'" + |
| | | "," + "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(licencePaper.getCreateTime()) + "'" + |
| | | "," + "'" + licencePaper.getUpdateUser() + "'" + |
| | | "," + "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(licencePaper.getUpdateTime()) + "'" + |
| | | "," + "'" + licencePaper.getDeptId() + "'" + |
| | | "," + "'" + licencePaper.getUrl() + "'" + ")"; |
| | | myAsyncService.dataSync(s); |
| | | } |
| | | }else { |
| | | licencePaper.setUpdateTime(new Date()); |
| | | licencePaperService.updateById(licencePaper); |
| | | boolean update = licencePaperService.updateById(licencePaper); |
| | | //数据同步 |
| | | if (update) { |
| | | String s1 = "update sys_licence_paper set type = " + "'" + licencePaper.getType() + "'" + |
| | | ",unit_name = " + "'" + licencePaper.getUnitName() + "'" + |
| | | ",address = " + "'" + licencePaper.getAddress() + "'" + |
| | | ",legal_people = " + "'" + licencePaper.getLegalPeople() + "'" + |
| | | ",content = " + "'" + licencePaper.getContent() + "'" + |
| | | ",approval_number = " + "'" + licencePaper.getApprovalNumber() + "'" + |
| | | ",licence_issuing_unit = " + "'" + licencePaper.getLicenceIssuingUnit() + "'" + |
| | | ",register_capital = " + "'" + licencePaper.getRegisterCapital() + "'" + |
| | | ",code = " + "'" + licencePaper.getCode() + "'" + |
| | | ",licence_issuing_time = " + "'" + new SimpleDateFormat("yyyy-MM-dd").format(licencePaper.getLicenceIssuingTime()) + "'" + |
| | | ",update_user = " + "'" + licencePaper.getUpdateUser() + "'" + |
| | | ",update_time = " + "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(licencePaper.getUpdateTime()) + "'" + |
| | | ",url = " + "'" + licencePaper.getUrl() + "'" + |
| | | " " + "where id = " + "'" + licencePaper.getId() + "'"; |
| | | myAsyncService.dataSync(s1); |
| | | } |
| | | } |
| | | return R.data(licencePaper); |
| | | } |