| | |
| | | import doumeemes.dao.business.model.Company; |
| | | import doumeemes.dao.business.model.CompanyLog; |
| | | import doumeemes.dao.business.model.CompanyOpen; |
| | | import doumeemes.dao.ext.vo.CompanyExtListVO; |
| | | import doumeemes.service.business.CompanyLogService; |
| | | import doumeemes.service.business.CompanyOpenService; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import doumeemes.service.ext.DepartmentExtService; |
| | | import org.apache.shiro.SecurityUtils; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.context.annotation.Lazy; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.util.CollectionUtils; |
| | |
| | | |
| | | @Autowired |
| | | CompanyLogService companyLogService; |
| | | |
| | | @Autowired |
| | | @Lazy |
| | | private DepartmentExtService departmentExtService; |
| | | |
| | | @Override |
| | | public Integer create(CompanyOpen companyOpen) { |
| | |
| | | company.setOepnValidDate(companyOpen.getValidDate()); |
| | | company.setOepnType(companyOpen.getOepnType()); |
| | | companyMapper.updateById(company); |
| | | |
| | | Company company1 = companyMapper.selectById(companyOpen.getCompanyId()); |
| | | |
| | | CompanyLog companyLog = new CompanyLog(); |
| | | companyLog.setDeleted((byte) Constants.ZERO); |
| | |
| | | companyLog.setUpdateType(Constants.CompanyUpdateType.UPDATE_VAIL_DATE.getKey()); |
| | | companyLog.setDetail("有效期从"+format.format(cyResult.getOepnValidDate())+"日调整至"+format.format(companyOpen.getValidDate())); |
| | | companyLogService.create(companyLog); |
| | | |
| | | initRedisCache(company1); |
| | | } |
| | | |
| | | private void initRedisCache(Company com) { |
| | | CompanyExtListVO c = new CompanyExtListVO(); |
| | | BeanUtils.copyProperties(com,c); |
| | | departmentExtService.loadComDepart(c); |
| | | departmentExtService.initCompnayCodesByCom(com); |
| | | } |
| | | |
| | | @Override |
| | |
| | | QueryWrapper<CompanyOpen> wrapper = new QueryWrapper<>(companyOpen); |
| | | return companyOpenMapper.selectList(wrapper); |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public PageData<CompanyOpen> findPage(PageWrap<CompanyOpen> pageWrap) { |
| | | IPage<CompanyOpen> page = new Page<>(pageWrap.getPage(), pageWrap.getCapacity()); |