|
|
|
@ -9,22 +9,21 @@ import com.ruoyi.common.exception.ServiceException;
|
|
|
|
|
import com.ruoyi.common.utils.SecurityUtils;
|
|
|
|
|
import com.ruoyi.common.utils.poi.ExcelUtil;
|
|
|
|
|
import com.ruoyi.jjh.declaration.entity.BmsEnterpriseBasicInfo;
|
|
|
|
|
import com.ruoyi.jjh.declaration.entity.request.EnterpriseInfoRequest;
|
|
|
|
|
import com.ruoyi.jjh.declaration.entity.request.EnterpriseInfoWorkRequest;
|
|
|
|
|
import com.ruoyi.jjh.declaration.service.IBmsEnterpriseBasicInfoService;
|
|
|
|
|
import com.ruoyi.jjh.ent.entity.JHeadQuartersRevenue;
|
|
|
|
|
import com.ruoyi.jjh.ent.service.JHeadQuartersRevenueService;
|
|
|
|
|
import com.ruoyi.jjh.ent.service.JServicesListService;
|
|
|
|
|
import io.swagger.annotations.Api;
|
|
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
|
|
|
import org.springframework.web.bind.annotation.PathVariable;
|
|
|
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
|
|
import org.springframework.web.bind.annotation.RequestParam;
|
|
|
|
|
import org.springframework.web.bind.annotation.RequestPart;
|
|
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
|
|
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
|
@ -42,6 +41,11 @@ public class BmsEnterpriseBasicInfoController extends BaseController {
|
|
|
|
|
@Autowired
|
|
|
|
|
private IBmsEnterpriseBasicInfoService bmsEnterpriseBasicInfoService;
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
private JServicesListService jServicesListService;
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
private JHeadQuartersRevenueService jHeadQuartersRevenueService;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 查询企业基础信息列表
|
|
|
|
@ -49,8 +53,8 @@ public class BmsEnterpriseBasicInfoController extends BaseController {
|
|
|
|
|
@PreAuthorize("@ss.hasAnyRoles('admin,other-gov,gov,sightseer')")
|
|
|
|
|
@ApiOperation(value = "查询企业基础信息列表", response = BmsEnterpriseBasicInfo.class)
|
|
|
|
|
@GetMapping("/list")
|
|
|
|
|
public AjaxResult list(Page<BmsEnterpriseBasicInfo> page, BmsEnterpriseBasicInfo bmsEnterpriseBasicInfo) {
|
|
|
|
|
return success(bmsEnterpriseBasicInfoService.page(page, bmsEnterpriseBasicInfo));
|
|
|
|
|
public AjaxResult list(Page<BmsEnterpriseBasicInfo> page, EnterpriseInfoRequest e) {
|
|
|
|
|
return success(bmsEnterpriseBasicInfoService.page(page, e));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
@ -70,8 +74,8 @@ public class BmsEnterpriseBasicInfoController extends BaseController {
|
|
|
|
|
@ApiOperation(value = "导出企业基础信息列表")
|
|
|
|
|
@Log(title = "企业基础信息", businessType = BusinessType.EXPORT)
|
|
|
|
|
@PostMapping("/export")
|
|
|
|
|
public void export(HttpServletResponse response, BmsEnterpriseBasicInfo bmsEnterpriseBasicInfo) {
|
|
|
|
|
List<BmsEnterpriseBasicInfo> list = bmsEnterpriseBasicInfoService.page(bmsEnterpriseBasicInfo);
|
|
|
|
|
public void export(HttpServletResponse response, EnterpriseInfoRequest e) {
|
|
|
|
|
List<BmsEnterpriseBasicInfo> list = bmsEnterpriseBasicInfoService.page(e);
|
|
|
|
|
ExcelUtil<BmsEnterpriseBasicInfo> util = new ExcelUtil<BmsEnterpriseBasicInfo>(BmsEnterpriseBasicInfo.class);
|
|
|
|
|
util.exportExcel(response, list, "企业基础信息数据");
|
|
|
|
|
}
|
|
|
|
@ -84,7 +88,7 @@ public class BmsEnterpriseBasicInfoController extends BaseController {
|
|
|
|
|
@ApiOperation(value = "导入企业基础信息列表")
|
|
|
|
|
@Log(title = "导入企业基础信息列表", businessType = BusinessType.IMPORT)
|
|
|
|
|
@PostMapping(value = "/importEnterprise", consumes = "multipart/form-data")
|
|
|
|
|
public AjaxResult importEnterprise(@RequestPart("file") MultipartFile file) throws Exception {
|
|
|
|
|
public AjaxResult importEnterprise(@RequestPart("file") MultipartFile file, String type) throws Exception {
|
|
|
|
|
List<BmsEnterpriseBasicInfo> allList = bmsEnterpriseBasicInfoService.list();
|
|
|
|
|
ExcelUtil<BmsEnterpriseBasicInfo> util = new ExcelUtil<>(BmsEnterpriseBasicInfo.class);
|
|
|
|
|
List<BmsEnterpriseBasicInfo> proList = util.importExcel(file.getInputStream());
|
|
|
|
@ -92,11 +96,11 @@ public class BmsEnterpriseBasicInfoController extends BaseController {
|
|
|
|
|
if (proList == null || proList.isEmpty()) {
|
|
|
|
|
throw new ServiceException("企业导入数据不能为空");
|
|
|
|
|
} else {
|
|
|
|
|
proList.forEach(entityA ->{
|
|
|
|
|
entityA.setType(2);
|
|
|
|
|
proList.forEach(entityA -> {
|
|
|
|
|
entityA.setType(type != null ? type : "2");
|
|
|
|
|
boolean b = allList.stream().anyMatch(entityB -> entityB.getTyshxydm().equals(entityA.getTyshxydm()));
|
|
|
|
|
if(b){
|
|
|
|
|
throw new ServiceException(entityA.getQymc()+"在企业库已重复,无法新增!");
|
|
|
|
|
if (b) {
|
|
|
|
|
throw new ServiceException(entityA.getQymc() + "在企业库已重复,无法新增!");
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
bmsEnterpriseBasicInfoService.saveBatch(proList);
|
|
|
|
@ -138,4 +142,56 @@ public class BmsEnterpriseBasicInfoController extends BaseController {
|
|
|
|
|
return success(bmsEnterpriseBasicInfoService.getById(id));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 将企业库企业更改分类
|
|
|
|
|
*/
|
|
|
|
|
// @ApiOperation(value = "将企业库企业更改分类", response = BmsEnterpriseBasicInfo.class)
|
|
|
|
|
// @GetMapping(value = "/changeType")
|
|
|
|
|
// public AjaxResult changeType() {
|
|
|
|
|
// List<BmsEnterpriseBasicInfo> list = bmsEnterpriseBasicInfoService.list();
|
|
|
|
|
//生产性服务业
|
|
|
|
|
// List<JServicesList> list1 = jServicesListService.lambdaQuery().eq(JServicesList::getServicesType, 1).list();
|
|
|
|
|
//限上批零住餐
|
|
|
|
|
// List<JServicesList> list2 = jServicesListService.lambdaQuery().eq(JServicesList::getServicesType, 4).list();
|
|
|
|
|
// //总部企业
|
|
|
|
|
// List<JHeadQuartersRevenue> list3 = jHeadQuartersRevenueService.list();
|
|
|
|
|
// for (BmsEnterpriseBasicInfo x : list) {
|
|
|
|
|
// for (JServicesList y : list1) {
|
|
|
|
|
// if(x.getTyshxydm().equals(y.getTyshxydm())){
|
|
|
|
|
// if(x.getType()==null){
|
|
|
|
|
// x.setType("5");
|
|
|
|
|
// }else {
|
|
|
|
|
// x.setType(x.getType()+","+"5");
|
|
|
|
|
// }
|
|
|
|
|
// bmsEnterpriseBasicInfoService.updateById(x);
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// for (BmsEnterpriseBasicInfo x : list) {
|
|
|
|
|
// for (JServicesList y : list2) {
|
|
|
|
|
// if(x.getTyshxydm().equals(y.getTyshxydm())){
|
|
|
|
|
// if(x.getType()==null){
|
|
|
|
|
// x.setType("6");
|
|
|
|
|
// }else {
|
|
|
|
|
// x.setType(x.getType()+","+"6");
|
|
|
|
|
// }
|
|
|
|
|
// bmsEnterpriseBasicInfoService.updateById(x);
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// for (BmsEnterpriseBasicInfo x : list) {
|
|
|
|
|
// for (JHeadQuartersRevenue y : list3) {
|
|
|
|
|
// if (x.getTyshxydm().equals(y.getTyshxydm())) {
|
|
|
|
|
// if (x.getType() == null) {
|
|
|
|
|
// x.setType("4");
|
|
|
|
|
// } else {
|
|
|
|
|
// x.setType(x.getType() + "," + "4");
|
|
|
|
|
// }
|
|
|
|
|
// bmsEnterpriseBasicInfoService.updateById(x);
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// return success();
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|