|
|
|
@ -12,8 +12,6 @@ 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.entity.JServicesList;
|
|
|
|
|
import com.ruoyi.jjh.ent.service.JHeadQuartersRevenueService;
|
|
|
|
|
import com.ruoyi.jjh.ent.service.JServicesListService;
|
|
|
|
|
import io.swagger.annotations.Api;
|
|
|
|
@ -26,7 +24,11 @@ import org.springframework.web.multipart.MultipartFile;
|
|
|
|
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
|
|
import java.io.IOException;
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
|
import java.util.HashSet;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
import java.util.Set;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 企业基础信息Controller
|
|
|
|
@ -148,23 +150,34 @@ public class BmsEnterpriseBasicInfoController extends BaseController {
|
|
|
|
|
*/
|
|
|
|
|
@ApiOperation(value = "将企业库企业更改分类", response = BmsEnterpriseBasicInfo.class)
|
|
|
|
|
@PreAuthorize("@ss.hasAnyRoles('admin')")
|
|
|
|
|
@GetMapping(value = "/changeType")
|
|
|
|
|
public AjaxResult changeType() {
|
|
|
|
|
@PostMapping(value = "/changeType", consumes = "multipart/form-data")
|
|
|
|
|
public AjaxResult changeType(@RequestPart("file") MultipartFile file) throws IOException {
|
|
|
|
|
List<BmsEnterpriseBasicInfo> list = bmsEnterpriseBasicInfoService.list();
|
|
|
|
|
//生活性服务业
|
|
|
|
|
List<JServicesList> list1 = jServicesListService.lambdaQuery().eq(JServicesList::getServicesType, 2).list();
|
|
|
|
|
for (BmsEnterpriseBasicInfo x : list) {
|
|
|
|
|
for (JServicesList y : list1) {
|
|
|
|
|
if (x.getTyshxydm().equals(y.getTyshxydm())) {
|
|
|
|
|
if ("2".equals(x.getType())) {
|
|
|
|
|
x.setType("7");
|
|
|
|
|
} else {
|
|
|
|
|
x.setType(x.getType() + "," + "7");
|
|
|
|
|
ExcelUtil<BmsEnterpriseBasicInfo> util = new ExcelUtil<>(BmsEnterpriseBasicInfo.class);
|
|
|
|
|
List<BmsEnterpriseBasicInfo> proList = util.importExcel(file.getInputStream());
|
|
|
|
|
|
|
|
|
|
//存储所有导入的信用代码
|
|
|
|
|
Set<String> tyshxydmSet = new HashSet<>();
|
|
|
|
|
for (BmsEnterpriseBasicInfo y : proList) {
|
|
|
|
|
tyshxydmSet.add(y.getTyshxydm());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
for (BmsEnterpriseBasicInfo x : list) {
|
|
|
|
|
if (tyshxydmSet.contains(x.getTyshxydm())) {
|
|
|
|
|
if(!"2".equals(x.getType())&& !"3".equals(x.getType())){
|
|
|
|
|
x.setType(x.getType()+","+"3");
|
|
|
|
|
bmsEnterpriseBasicInfoService.updateById(x);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
for (BmsEnterpriseBasicInfo y : list) {
|
|
|
|
|
proList.removeIf(x->x.getTyshxydm().equals(y.getTyshxydm()));
|
|
|
|
|
}
|
|
|
|
|
proList.forEach(x->{
|
|
|
|
|
x.setType("3");
|
|
|
|
|
bmsEnterpriseBasicInfoService.save(x);
|
|
|
|
|
});
|
|
|
|
|
return success();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|