|
@@ -4,9 +4,11 @@ import com.baidu.ueditor.ActionEnter;
|
|
|
import com.baidu.ueditor.define.ActionMap;
|
|
|
import com.baidu.ueditor.define.BaseState;
|
|
|
import com.github.pagehelper.PageInfo;
|
|
|
+import com.yc.education.mapper.ProviderMapper;
|
|
|
import com.yc.education.model.*;
|
|
|
import com.yc.education.service.*;
|
|
|
import com.yc.education.util.*;
|
|
|
+import org.apache.commons.lang3.StringUtils;
|
|
|
import org.apache.poi.hssf.usermodel.*;
|
|
|
import org.apache.poi.ss.usermodel.Cell;
|
|
|
import org.apache.poi.ss.usermodel.Row;
|
|
@@ -30,6 +32,7 @@ import java.text.SimpleDateFormat;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.Date;
|
|
|
import java.util.List;
|
|
|
+import java.util.Objects;
|
|
|
|
|
|
/**
|
|
|
* @author wuzhiqiang
|
|
@@ -50,7 +53,7 @@ public class SupplierAdminController {
|
|
|
private IBrandService iBrandService;
|
|
|
|
|
|
@Autowired
|
|
|
- private ISinglePartsTypeService iSinglePartsTypeService;//单项件类别
|
|
|
+ private ISinglePartsTypeService iSinglePartsTypeService;//单项件类别
|
|
|
|
|
|
@Autowired
|
|
|
private ICarPartsSingleService iCarPartsSingleService;//单项件
|
|
@@ -59,13 +62,13 @@ public class SupplierAdminController {
|
|
|
private ICarSedanService iCarSedanService;//车系
|
|
|
|
|
|
@Autowired
|
|
|
- private ICarProductionsTypeService iCarProductionsTypeService;//汽车用品和汽保设备与工具
|
|
|
+ private ICarProductionsTypeService iCarProductionsTypeService;//汽车用品和汽保设备与工具
|
|
|
|
|
|
@Autowired
|
|
|
private ICarCommerialService iCarCommerialService;//商用车
|
|
|
|
|
|
@Autowired
|
|
|
- private AdminsService adminsService;
|
|
|
+ private AdminsService adminsService;
|
|
|
|
|
|
@Autowired
|
|
|
private IAuthenticationService iAuthenticationService;
|
|
@@ -76,8 +79,12 @@ public class SupplierAdminController {
|
|
|
@Autowired
|
|
|
private IServiceCategoryService iServiceCategoryService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private ProviderMapper providerMapper;
|
|
|
+
|
|
|
/**
|
|
|
* 供应商信息列表
|
|
|
+ *
|
|
|
* @param company
|
|
|
* @param brandId
|
|
|
* @param status
|
|
@@ -88,139 +95,141 @@ public class SupplierAdminController {
|
|
|
*/
|
|
|
@RequestMapping("supplierList.html")
|
|
|
public ModelAndView listAllSupplierInfo(
|
|
|
- @RequestParam(defaultValue = "") String isImport,
|
|
|
+ @RequestParam(defaultValue = "0") String isImport,
|
|
|
@RequestParam(defaultValue = "") String company,
|
|
|
@RequestParam(defaultValue = "") Integer brandId,
|
|
|
@RequestParam(defaultValue = "") String status,
|
|
|
@RequestParam(defaultValue = "") String isUse,
|
|
|
@RequestParam(defaultValue = "1") Integer pageNum,
|
|
|
- @RequestParam(defaultValue = "10") Integer pageSize){
|
|
|
+ @RequestParam(defaultValue = "10") Integer pageSize) {
|
|
|
|
|
|
- ModelAndView mav = new ModelAndView();
|
|
|
+ ModelAndView mav = new ModelAndView( );
|
|
|
|
|
|
- List<Provider> listAllSupplierInfo = iProviderService.listAllSupplierInfo(isImport,company,brandId,status,isUse,pageNum,pageSize);//多条件查询
|
|
|
+ List< Provider > listAllSupplierInfo = iProviderService.listAllSupplierInfo(isImport, company, brandId, status, isUse, pageNum, pageSize);//多条件查询
|
|
|
|
|
|
- List<Authentication> listAllAuthentication = iAuthenticationService.listAuthenticationInfoProvider("","","","",1,Integer.MAX_VALUE);
|
|
|
+ List< Authentication > listAllAuthentication = iAuthenticationService.listAuthenticationInfoProvider("", "", "", "", 1, Integer.MAX_VALUE);
|
|
|
|
|
|
- List<Recommender> listAllRecommender = iRecommenderService.listAllRecommender(1,Integer.MAX_VALUE);//查询所有推荐人信息
|
|
|
+ List< Recommender > listAllRecommender = iRecommenderService.listAllRecommender(1, Integer.MAX_VALUE);//查询所有推荐人信息
|
|
|
|
|
|
- List<Provider> listAllCompanyName = iProviderService.listAllCompanyNames();
|
|
|
+ List< Provider > listAllCompanyName = iProviderService.listAllCompanyNames( );
|
|
|
|
|
|
- List<Brand> listAllBrandInfo = iBrandService.listAllBrandInfo();//查询所有品牌信息
|
|
|
+ List< Brand > listAllBrandInfo = iBrandService.listAllBrandInfo( );//查询所有品牌信息
|
|
|
|
|
|
- if (listAllSupplierInfo != null && listAllSupplierInfo.size()!=0) {
|
|
|
+ if (listAllSupplierInfo != null && listAllSupplierInfo.size( ) != 0) {
|
|
|
|
|
|
for (Provider provider : listAllSupplierInfo) {
|
|
|
|
|
|
- if (provider.getUserId() != null) { /*如果userId不为空就查出用户昵称赋值给nickname*/
|
|
|
+ if (provider.getUserId( ) != null) { /*如果userId不为空就查出用户昵称赋值给nickname*/
|
|
|
|
|
|
- UserInfo userInfo = iUserInfoService.selectByKey(provider.getUserId());
|
|
|
+ UserInfo userInfo = iUserInfoService.selectByKey(provider.getUserId( ));
|
|
|
if (userInfo != null) {
|
|
|
- provider.setNickName(userInfo.getNickName());//设置用户昵称
|
|
|
+ provider.setNickName(userInfo.getNickName( ));//设置用户昵称
|
|
|
}
|
|
|
} else { /*如果 userId查出为空 根据电话号码查出用户昵称 给nickname赋值 */
|
|
|
- UserInfo userInfo = iUserInfoService.listInfoByTelphone(provider.getAuthPhone());
|
|
|
+ UserInfo userInfo = iUserInfoService.listInfoByTelphone(provider.getAuthPhone( ));
|
|
|
|
|
|
if (userInfo != null) { /*判断根据电话号码查出的用户信息是否为空*/
|
|
|
- provider.setNickName(userInfo.getNickName());
|
|
|
+ provider.setNickName(userInfo.getNickName( ));
|
|
|
}
|
|
|
/*provider.setUserId(userInfo.getId());*/
|
|
|
}
|
|
|
|
|
|
/*从认证表中获取认证时间*/
|
|
|
- if (listAllAuthentication != null && listAllAuthentication.size() != 0) {
|
|
|
+ if (listAllAuthentication != null && listAllAuthentication.size( ) != 0) {
|
|
|
|
|
|
for (Authentication authentication : listAllAuthentication) {
|
|
|
|
|
|
- if (authentication.getStoreId().equals(provider.getId())) {
|
|
|
- provider.setAuTime(authentication.getCreateDate());//给认证时间赋值
|
|
|
+ if (authentication.getStoreId( ).equals(provider.getId( ))) {
|
|
|
+ provider.setAuTime(authentication.getCreateDate( ));//给认证时间赋值
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
/*从推荐人表中获取推荐人姓名,电话,城市*/
|
|
|
- if (listAllRecommender != null && listAllRecommender.size() != 0) {
|
|
|
+ if (listAllRecommender != null && listAllRecommender.size( ) != 0) {
|
|
|
|
|
|
for (Recommender recommender : listAllRecommender) {
|
|
|
|
|
|
- if (recommender.getPhone().equals(provider.getReferrerPhone())) {
|
|
|
- provider.setReferTelphon(recommender.getPhone());//设置推荐人电话
|
|
|
- provider.setReferName(recommender.getName());//设置推荐人姓名
|
|
|
- provider.setReferCity(recommender.getCity());//设置推荐人城市
|
|
|
+ if (recommender.getPhone( ).equals(provider.getReferrerPhone( ))) {
|
|
|
+ provider.setReferTelphon(recommender.getPhone( ));//设置推荐人电话
|
|
|
+ provider.setReferName(recommender.getName( ));//设置推荐人姓名
|
|
|
+ provider.setReferCity(recommender.getCity( ));//设置推荐人城市
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
}
|
|
|
}
|
|
|
- mav.addObject("pageInfo",new PageInfo<Provider>(listAllSupplierInfo));
|
|
|
- mav.addObject("companyName",listAllCompanyName);//查询公司名称当条件
|
|
|
- mav.addObject("brand",listAllBrandInfo);
|
|
|
- mav.addObject("company",company);
|
|
|
- mav.addObject("brandId",brandId);
|
|
|
- mav.addObject("status",status);
|
|
|
- mav.addObject("isUse",isUse);
|
|
|
- mav.addObject("isImport",isImport);
|
|
|
- mav.addObject("pageNum",pageNum);
|
|
|
- mav.addObject("pageSize",pageSize);
|
|
|
+ mav.addObject("pageInfo", new PageInfo< Provider >(listAllSupplierInfo));
|
|
|
+ mav.addObject("companyName", listAllCompanyName);//查询公司名称当条件
|
|
|
+ mav.addObject("brand", listAllBrandInfo);
|
|
|
+ mav.addObject("company", company);
|
|
|
+ mav.addObject("brandId", brandId);
|
|
|
+ mav.addObject("status", status);
|
|
|
+ mav.addObject("isUse", isUse);
|
|
|
+ mav.addObject("isImport", isImport);
|
|
|
+ mav.addObject("pageNum", pageNum);
|
|
|
+ mav.addObject("pageSize", pageSize);
|
|
|
|
|
|
|
|
|
- return mav;
|
|
|
+ return mav;
|
|
|
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 添加 跳转
|
|
|
+ *
|
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping("supplierAdd.html")
|
|
|
- public ModelAndView supplierAdd(){
|
|
|
+ public ModelAndView supplierAdd( ) {
|
|
|
|
|
|
- ModelAndView mav = new ModelAndView();
|
|
|
+ ModelAndView mav = new ModelAndView( );
|
|
|
|
|
|
- List<Brand> listAllBrandInfo = iBrandService.listAllBrandInfo();//查询所有品牌信息
|
|
|
+ List< Brand > listAllBrandInfo = iBrandService.listAllBrandInfo( );//查询所有品牌信息
|
|
|
|
|
|
- mav.addObject("brand",listAllBrandInfo);
|
|
|
+ mav.addObject("brand", listAllBrandInfo);
|
|
|
return mav;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 添加 实现
|
|
|
+ *
|
|
|
* @param provider
|
|
|
* @param request
|
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping("supplierAdds.html")
|
|
|
- public ModelAndView supplierAdd(Provider provider,HttpServletRequest request){
|
|
|
+ public ModelAndView supplierAdd(Provider provider, HttpServletRequest request) {
|
|
|
|
|
|
- Integer loginId =Integer.valueOf(request.getSession().getAttribute("loginId").toString());//获取后台登录人id
|
|
|
+ Integer loginId = Integer.valueOf(request.getSession( ).getAttribute("loginId").toString( ));//获取后台登录人id
|
|
|
|
|
|
Admins admins = adminsService.selectByKey(loginId);//查询当前登录人的信息
|
|
|
|
|
|
- String rootPath = request.getSession().getServletContext().getRealPath("/");
|
|
|
+ String rootPath = request.getSession( ).getServletContext( ).getRealPath("/");
|
|
|
|
|
|
- String contextPath = request.getSession().getServletContext().getContextPath();
|
|
|
+ String contextPath = request.getSession( ).getServletContext( ).getContextPath( );
|
|
|
BaseState state = (BaseState) new ActionEnter(request, rootPath, contextPath, "admin")
|
|
|
.invoke(ActionMap.UPLOAD_FILE);
|
|
|
provider.setImgLog(state.getInfo("url"));
|
|
|
|
|
|
- provider.setEnterDate(new Date());//设置默认值
|
|
|
+ provider.setEnterDate(new Date( ));//设置默认值
|
|
|
provider.setStatus("0");
|
|
|
provider.setIsHot("0");
|
|
|
provider.setPv(0);
|
|
|
- provider.setCreateDate(new Date());
|
|
|
- provider.setModifiedDate(new Date());
|
|
|
+ provider.setCreateDate(new Date( ));
|
|
|
+ provider.setModifiedDate(new Date( ));
|
|
|
provider.setRoleType("2");
|
|
|
provider.setIsUse("0");
|
|
|
provider.setServiceItem("0");
|
|
|
provider.setPhotos("0");
|
|
|
provider.setIsLine("0");
|
|
|
provider.setIsImport("1");
|
|
|
- provider.setOperator(admins.getLoginname());
|
|
|
+ provider.setOperator(admins.getLoginname( ));
|
|
|
provider.setImgLog(CommonCons.DEFAULT_STORE_LOGO);
|
|
|
provider.setImgBanner(CommonCons.DEFAULT_STORE_BANNER);
|
|
|
|
|
|
/*根据省市区三级联动的值,赋值给店铺地址*/
|
|
|
- provider.setAddress(provider.getProvince()+provider.getCity()+provider.getDistrict()+provider.getStree());
|
|
|
+ provider.setAddress(provider.getProvince( ) + provider.getCity( ) + provider.getDistrict( ) + provider.getStree( ));
|
|
|
|
|
|
/* Brand brand = iBrandService.selectByPrimaryKey(Integer.valueOf(provider.getBrandId()));//查询品牌信息
|
|
|
|
|
@@ -229,62 +238,83 @@ public class SupplierAdminController {
|
|
|
}*/
|
|
|
|
|
|
/*根据地址获取经纬度*/
|
|
|
- provider.setAddress(provider.getProvince()+provider.getCity()+provider.getDistrict()+provider.getStree());
|
|
|
- if(provider.getAddress() != null && !"".equals(provider.getAddress())){
|
|
|
+ provider.setAddress(provider.getProvince( ) + provider.getCity( ) + provider.getDistrict( ) + provider.getStree( ));
|
|
|
+ if (provider.getAddress( ) != null && !"".equals(provider.getAddress( ))) {
|
|
|
|
|
|
- String str = MapUtils.getLongitudeLatitude(provider.getAddress());//根据地址获取经纬度字符串
|
|
|
- if(!"".equals(str) && str != null){
|
|
|
+ String str = MapUtils.getLongitudeLatitude(provider.getAddress( ));//根据地址获取经纬度字符串
|
|
|
+ if (!"".equals(str) && str != null) {
|
|
|
String[] arr = str.split(",");//用逗号将字符串分开
|
|
|
provider.setLongitude(arr[0]);//赋值给经度
|
|
|
provider.setLatitude(arr[1]);//赋值给纬度
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
provider.setLatitude("0");
|
|
|
provider.setLongitude("0");
|
|
|
}
|
|
|
}
|
|
|
- UserInfo userInfo = iUserInfoService.listInfoByTelphone(provider.getAuthPhone());//根据电话号码查询用户信息
|
|
|
- if(userInfo != null){
|
|
|
- provider.setUserId(userInfo.getId());//将用户id赋值给userId
|
|
|
+ UserInfo userInfo = iUserInfoService.listInfoByTelphone(provider.getAuthPhone( ));//根据电话号码查询用户信息
|
|
|
+ if (userInfo != null) {
|
|
|
+ provider.setUserId(userInfo.getId( ));//将用户id赋值给userId
|
|
|
}
|
|
|
+ String paramType = provider.getParamType( );
|
|
|
+
|
|
|
+ int row = providerMapper.insertUseGeneratedKeys(provider);
|
|
|
|
|
|
- int row = iProviderService.save(provider);
|
|
|
+ //当是经销商的时候 添加经销商搜索
|
|
|
+ new Thread(( ) -> {
|
|
|
+ // 1,3,4,5 代表是 普通类型 1汽配(单项件),2汽配(全车件) ,3用品改装,4汽保设备与工具,5商用车(单项件) 6商用车(全车件)
|
|
|
+ if ("1".equals(paramType) || "3".equals(paramType) || "4".equals(paramType) || "5".equals(paramType)) {
|
|
|
+ iProviderService.saveSearchDealer(paramType, provider.getId(), provider.getpMainBusiness(), provider.getMianBusiness());
|
|
|
+ }
|
|
|
+ // 2 代表全车件
|
|
|
+ if ("2".equals(paramType)) {
|
|
|
+ iProviderService.saveAllCar(provider.getId(), provider.getMianBusiness());
|
|
|
+ }
|
|
|
+ // 6 代表商务车
|
|
|
+ if ("6".equals(paramType)) {
|
|
|
+ iProviderService.saveCommercial(provider.getId(), provider.getMianBusiness());
|
|
|
+ }
|
|
|
+ }).start( );
|
|
|
|
|
|
- return ViewUtil.returnview(row,"supplierList.html","供应商列表");
|
|
|
+
|
|
|
+
|
|
|
+ return ViewUtil.returnview(row, "supplierList.html", "供应商列表");
|
|
|
}
|
|
|
|
|
|
|
|
|
/**
|
|
|
* 修改 跳转
|
|
|
+ *
|
|
|
* @param id
|
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping("supplierUpdate.html")
|
|
|
- public ModelAndView supplierUpdate(Long id){
|
|
|
+ public ModelAndView supplierUpdate(Long id) {
|
|
|
|
|
|
- ModelAndView mav = new ModelAndView();
|
|
|
+ ModelAndView mav = new ModelAndView( );
|
|
|
|
|
|
- List<Brand> listAllBrandInfo = iBrandService.listAllBrandInfo();//查询所有品牌信息
|
|
|
+ List< Brand > listAllBrandInfo = iBrandService.listAllBrandInfo( );//查询所有品牌信息
|
|
|
|
|
|
Provider provider = iProviderService.selectByKey(id);
|
|
|
|
|
|
- mav.addObject("brand",listAllBrandInfo);
|
|
|
- mav.addObject("provider",provider);
|
|
|
+ mav.addObject("brand", listAllBrandInfo);
|
|
|
+ mav.addObject("provider", provider);
|
|
|
|
|
|
- return mav;
|
|
|
+ return mav;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 修改 实现
|
|
|
+ *
|
|
|
* @param provider
|
|
|
* @param request
|
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping("supplierUpdates.html")
|
|
|
- public ModelAndView toUpdates(Provider provider, HttpServletRequest request){
|
|
|
+ public ModelAndView toUpdates(Provider provider, HttpServletRequest request) {
|
|
|
|
|
|
- String rootPath = request.getSession().getServletContext().getRealPath("/");
|
|
|
+ String rootPath = request.getSession( ).getServletContext( ).getRealPath("/");
|
|
|
|
|
|
- String contextPath = request.getSession().getServletContext().getContextPath();
|
|
|
+ String contextPath = request.getSession( ).getServletContext( ).getContextPath( );
|
|
|
BaseState state = (BaseState) new ActionEnter(request, rootPath, contextPath, "admin")
|
|
|
.invoke(ActionMap.UPLOAD_FILE);
|
|
|
provider.setImgLog(state.getInfo("url"));
|
|
@@ -295,70 +325,91 @@ public class SupplierAdminController {
|
|
|
}*/
|
|
|
|
|
|
/*根据地址获取经纬度*/
|
|
|
- provider.setAddress(provider.getProvince()+provider.getCity()+provider.getDistrict()+provider.getStree());
|
|
|
- if(provider.getAddress() != null && !"".equals(provider.getAddress())){
|
|
|
+ provider.setAddress(provider.getProvince( ) + provider.getCity( ) + provider.getDistrict( ) + provider.getStree( ));
|
|
|
+ if (provider.getAddress( ) != null && !"".equals(provider.getAddress( ))) {
|
|
|
|
|
|
- String str = MapUtils.getLongitudeLatitude(provider.getAddress());//根据地址获取经纬度字符串
|
|
|
- if(!"".equals(str) && str != null){
|
|
|
+ String str = MapUtils.getLongitudeLatitude(provider.getAddress( ));//根据地址获取经纬度字符串
|
|
|
+ if (!"".equals(str) && str != null) {
|
|
|
String[] arr = str.split(",");//用逗号将字符串分开
|
|
|
provider.setLongitude(arr[0]);//赋值给经度
|
|
|
provider.setLatitude(arr[1]);//赋值给纬度
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
provider.setLatitude("0");
|
|
|
provider.setLongitude("0");
|
|
|
}
|
|
|
}
|
|
|
- provider.setAddress(provider.getProvince()+provider.getCity()+provider.getDistrict()+provider.getStree());//给address赋值
|
|
|
+ provider.setAddress(provider.getProvince( ) + provider.getCity( ) + provider.getDistrict( ) + provider.getStree( ));//给address赋值
|
|
|
|
|
|
int row = iProviderService.updateNotNull(provider);
|
|
|
|
|
|
- return ViewUtil.returnview(row,"supplierList.html?company="+provider.getCompanyName(),"供应商列表");
|
|
|
+ String paramType = provider.getParamType( );
|
|
|
+ //当是经销商的时候 添加经销商搜索
|
|
|
+ new Thread(( ) -> {
|
|
|
+ // 1,3,4,5 代表是 普通类型 1汽配(单项件),2汽配(全车件) ,3用品改装,4汽保设备与工具,5商用车(单项件) 6商用车(全车件)
|
|
|
+ if ("1".equals(paramType) || "3".equals(paramType) || "4".equals(paramType) || "5".equals(paramType)) {
|
|
|
+ iProviderService.saveSearchDealer(paramType, provider.getId(), provider.getpMainBusiness(), provider.getMianBusiness());
|
|
|
+ }
|
|
|
+ // 2 代表全车件
|
|
|
+ if ("2".equals(paramType)) {
|
|
|
+ iProviderService.saveAllCar(provider.getId(), provider.getMianBusiness());
|
|
|
+ }
|
|
|
+ // 6 代表商务车
|
|
|
+ if ("6".equals(paramType)) {
|
|
|
+ iProviderService.saveCommercial(provider.getId(), provider.getMianBusiness());
|
|
|
+ }
|
|
|
+ }).start( );
|
|
|
+
|
|
|
+
|
|
|
+ return ViewUtil.returnview(row, "supplierList.html?company=" + provider.getCompanyName( ), "供应商列表");
|
|
|
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 删除
|
|
|
+ *
|
|
|
* @param id
|
|
|
* @return
|
|
|
*/
|
|
|
@ResponseBody
|
|
|
@RequestMapping("supplierDel.html")
|
|
|
- public AjaxMessage<Object> supplierDel(String id){
|
|
|
+ public AjaxMessage< Object > supplierDel(String id) {
|
|
|
|
|
|
- AjaxMessage am = new AjaxMessage();
|
|
|
+ AjaxMessage am = new AjaxMessage( );
|
|
|
|
|
|
- String [] idlist = id.split(",");
|
|
|
+ String[] idlist = id.split(",");
|
|
|
|
|
|
int row = 0;
|
|
|
|
|
|
- for (String string : idlist){
|
|
|
+ for (String string : idlist) {
|
|
|
row += iProviderService.delete(Long.valueOf(string));
|
|
|
}
|
|
|
- if (row > 0 ){
|
|
|
+ if (row > 0) {
|
|
|
am.setIs(true);
|
|
|
am.setMsg(" 删除成功");
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
am.setIs(false);
|
|
|
am.setMsg(" 删除失败");
|
|
|
}
|
|
|
|
|
|
- return am;
|
|
|
+ return am;
|
|
|
}
|
|
|
+
|
|
|
/**
|
|
|
* 删除全部后台录入信息
|
|
|
+ *
|
|
|
* @return
|
|
|
*/
|
|
|
@ResponseBody
|
|
|
@RequestMapping("supplierDels.html")
|
|
|
- public AjaxMessage<Object> supplierDels(){
|
|
|
- AjaxMessage<Object> am = new AjaxMessage<>();
|
|
|
+ public AjaxMessage< Object > supplierDels( ) {
|
|
|
+ AjaxMessage< Object > am = new AjaxMessage<>( );
|
|
|
|
|
|
- int rows = iProviderService.deleteEvery();//删除全部后台录入信息
|
|
|
+ int rows = iProviderService.deleteEvery( );//删除全部后台录入信息
|
|
|
|
|
|
- if (rows > 0){
|
|
|
+ if (rows > 0) {
|
|
|
am.setIs(true);
|
|
|
am.setMsg("删除成功");
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
am.setIs(false);
|
|
|
am.setMsg("删除失败");
|
|
|
}
|
|
@@ -368,51 +419,56 @@ public class SupplierAdminController {
|
|
|
|
|
|
/**
|
|
|
* 商家状态修改(禁用, 启用)
|
|
|
+ *
|
|
|
* @param id
|
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping("supplierLineUpdates.html")
|
|
|
- public ModelAndView supplierLineUpdates (Long id){
|
|
|
+ public ModelAndView supplierLineUpdates(Long id) {
|
|
|
|
|
|
Provider provider = iProviderService.selectByKey(id);
|
|
|
|
|
|
- if ("0".equals(provider.getIsLine())){
|
|
|
+ if ("0".equals(provider.getIsLine( ))) {
|
|
|
provider.setIsLine("1");
|
|
|
} else {
|
|
|
provider.setIsLine("0");
|
|
|
}
|
|
|
|
|
|
int row = iProviderService.updateNotNull(provider);
|
|
|
- return ViewUtil.returnview(row,"supplierList.html","商家信息列表");
|
|
|
+ return ViewUtil.returnview(row, "supplierList.html", "商家信息列表");
|
|
|
}
|
|
|
|
|
|
/* 1 经销商信息添加 经营范围的选择实现 选中汽车配件后的经营范围*/
|
|
|
+
|
|
|
/**
|
|
|
* 查询单项件种类 (底盘件,发动机件等)
|
|
|
+ *
|
|
|
* @return
|
|
|
*/
|
|
|
@ResponseBody
|
|
|
@RequestMapping("listSingleType.html")
|
|
|
- public AjaxMessage<Object> listSingleType(){
|
|
|
- AjaxMessage<Object> am = new AjaxMessage<>();
|
|
|
- List<ServiceCategory> listOneType =iServiceCategoryService.listSingleKind();
|
|
|
- if (listOneType != null || !"".equals(listOneType)){
|
|
|
+ public AjaxMessage< Object > listSingleType( ) {
|
|
|
+ AjaxMessage< Object > am = new AjaxMessage<>( );
|
|
|
+ List< ServiceCategory > listOneType = iServiceCategoryService.listSingleKind( );
|
|
|
+ if (listOneType != null || !"".equals(listOneType)) {
|
|
|
am.setIs(true);
|
|
|
am.setData(listOneType);
|
|
|
}
|
|
|
return am;
|
|
|
}
|
|
|
+
|
|
|
/**
|
|
|
* 查询单项件种类下的服务名称
|
|
|
+ *
|
|
|
* @param id
|
|
|
* @return
|
|
|
*/
|
|
|
@ResponseBody
|
|
|
@RequestMapping("listServiceById.html")
|
|
|
- public AjaxMessage<Object> listServiceById(String id){
|
|
|
- AjaxMessage<Object> am = new AjaxMessage<>();
|
|
|
- List<ServiceCategory> listServiceById = iServiceCategoryService.listServiceCategoryByPid(Integer.valueOf(id.trim()));
|
|
|
- if (listServiceById != null && !"".equals(listServiceById)){
|
|
|
+ public AjaxMessage< Object > listServiceById(String id) {
|
|
|
+ AjaxMessage< Object > am = new AjaxMessage<>( );
|
|
|
+ List< ServiceCategory > listServiceById = iServiceCategoryService.listServiceCategoryByPid(Integer.valueOf(id.trim( )));
|
|
|
+ if (listServiceById != null && !"".equals(listServiceById)) {
|
|
|
am.setIs(true);
|
|
|
am.setData(listServiceById);
|
|
|
}
|
|
@@ -422,31 +478,34 @@ public class SupplierAdminController {
|
|
|
/**
|
|
|
* 全车件下的信息
|
|
|
* 查询国别(欧系,美系,韩系,国产等)
|
|
|
+ *
|
|
|
* @return
|
|
|
*/
|
|
|
@ResponseBody
|
|
|
@RequestMapping("listCarTrain.html")
|
|
|
- public AjaxMessage<Object> listCarTrain(){
|
|
|
- AjaxMessage<Object> am = new AjaxMessage<>();
|
|
|
- List<CarSedan> listCarTrain = iCarSedanService.listCarSedanByCountry();
|
|
|
- if (listCarTrain != null && !"".equals(listCarTrain)){
|
|
|
+ public AjaxMessage< Object > listCarTrain( ) {
|
|
|
+ AjaxMessage< Object > am = new AjaxMessage<>( );
|
|
|
+ List< CarSedan > listCarTrain = iCarSedanService.listCarSedanByCountry( );
|
|
|
+ if (listCarTrain != null && !"".equals(listCarTrain)) {
|
|
|
am.setIs(true);
|
|
|
am.setData(listCarTrain);
|
|
|
}
|
|
|
return am;
|
|
|
}
|
|
|
+
|
|
|
/**
|
|
|
* 根据国别查询车型
|
|
|
+ *
|
|
|
* @param type
|
|
|
* @return
|
|
|
*/
|
|
|
@ResponseBody
|
|
|
@RequestMapping("listCarSedanBrand.html")
|
|
|
- public AjaxMessage<Object> listCarSedanBrand(String type){
|
|
|
- AjaxMessage<Object> am = new AjaxMessage<>();
|
|
|
+ public AjaxMessage< Object > listCarSedanBrand(String type) {
|
|
|
+ AjaxMessage< Object > am = new AjaxMessage<>( );
|
|
|
|
|
|
- List<CarSedan> listBrand = iCarSedanService.listCarSedanByBrand(type,"",1,Integer.MAX_VALUE);
|
|
|
- if (listBrand != null && !"".equals(listBrand)){
|
|
|
+ List< CarSedan > listBrand = iCarSedanService.listCarSedanByBrand(type, "", 1, Integer.MAX_VALUE);
|
|
|
+ if (listBrand != null && !"".equals(listBrand)) {
|
|
|
am.setIs(true);
|
|
|
am.setData(listBrand);
|
|
|
}
|
|
@@ -456,63 +515,70 @@ public class SupplierAdminController {
|
|
|
|
|
|
/**
|
|
|
* 查询汽车用品下的类别名称
|
|
|
+ *
|
|
|
* @return
|
|
|
*/
|
|
|
@ResponseBody
|
|
|
@RequestMapping("carUseProduct.html")
|
|
|
- public AjaxMessage<Object> carUseProduct(){
|
|
|
- AjaxMessage<Object> am = new AjaxMessage<>();
|
|
|
- List<ServiceCategory> listCarUseType = iServiceCategoryService.listCarUseType();//查询汽车用品下的类别
|
|
|
- if (listCarUseType != null && !"".equals(listCarUseType)){
|
|
|
+ public AjaxMessage< Object > carUseProduct( ) {
|
|
|
+ AjaxMessage< Object > am = new AjaxMessage<>( );
|
|
|
+ List< ServiceCategory > listCarUseType = iServiceCategoryService.listCarUseType( );//查询汽车用品下的类别
|
|
|
+ if (listCarUseType != null && !"".equals(listCarUseType)) {
|
|
|
am.setIs(true);
|
|
|
am.setData(listCarUseType);
|
|
|
}
|
|
|
return am;
|
|
|
}
|
|
|
+
|
|
|
/**
|
|
|
* 跟据类别id查询父类id是此i的信息
|
|
|
+ *
|
|
|
* @param id
|
|
|
* @return
|
|
|
*/
|
|
|
@ResponseBody
|
|
|
@RequestMapping("listUseById.html")
|
|
|
- public AjaxMessage<Object> listUseByType( String id){
|
|
|
- AjaxMessage<Object> am = new AjaxMessage<>();
|
|
|
- List<ServiceCategory> listUseById = iServiceCategoryService.listServiceCategoryByPid(Integer.valueOf(id.trim()));
|
|
|
- if (listUseById != null && !"".equals(listUseById)){
|
|
|
+ public AjaxMessage< Object > listUseByType(String id) {
|
|
|
+ AjaxMessage< Object > am = new AjaxMessage<>( );
|
|
|
+ List< ServiceCategory > listUseById = iServiceCategoryService.listServiceCategoryByPid(Integer.valueOf(id.trim( )));
|
|
|
+ if (listUseById != null && !"".equals(listUseById)) {
|
|
|
am.setIs(true);
|
|
|
am.setData(listUseById);
|
|
|
}
|
|
|
return am;
|
|
|
}
|
|
|
/* 3 经销商信息添加 经营范围的选择实现 选中汽保设备与工具后的经营范围*/
|
|
|
+
|
|
|
/**
|
|
|
* 查询汽保设备与工具下的类别名称
|
|
|
+ *
|
|
|
* @return
|
|
|
*/
|
|
|
@ResponseBody
|
|
|
@RequestMapping("carEquipmentTool.html")
|
|
|
- public AjaxMessage<Object> carEquipmentTool(){
|
|
|
- AjaxMessage<Object> am = new AjaxMessage<>();
|
|
|
- List<ServiceCategory> listCarcarEquipmentTool = iServiceCategoryService.listCarEquipmentTool();//查询汽保设备与工具下的类别
|
|
|
- if (listCarcarEquipmentTool != null && !"".equals(listCarcarEquipmentTool)){
|
|
|
+ public AjaxMessage< Object > carEquipmentTool( ) {
|
|
|
+ AjaxMessage< Object > am = new AjaxMessage<>( );
|
|
|
+ List< ServiceCategory > listCarcarEquipmentTool = iServiceCategoryService.listCarEquipmentTool( );//查询汽保设备与工具下的类别
|
|
|
+ if (listCarcarEquipmentTool != null && !"".equals(listCarcarEquipmentTool)) {
|
|
|
am.setIs(true);
|
|
|
am.setData(listCarcarEquipmentTool);
|
|
|
}
|
|
|
return am;
|
|
|
}
|
|
|
/* 4 经销商信息添加 经营范围的选择实现 选中商用车的经营范围*/
|
|
|
+
|
|
|
/**
|
|
|
* 全车件下的信息
|
|
|
* 查询类别(客车,货车,自卸车,牵引车)
|
|
|
+ *
|
|
|
* @return
|
|
|
*/
|
|
|
@ResponseBody
|
|
|
@RequestMapping("listCarCategory.html")
|
|
|
- public AjaxMessage<Object> listCarCategory(){
|
|
|
- AjaxMessage<Object> am = new AjaxMessage<>();
|
|
|
- List<CarCommercial> listCarCategory = iCarCommerialService.listCarCommercialByCategory();
|
|
|
- if (listCarCategory != null && !"".equals(listCarCategory)){
|
|
|
+ public AjaxMessage< Object > listCarCategory( ) {
|
|
|
+ AjaxMessage< Object > am = new AjaxMessage<>( );
|
|
|
+ List< CarCommercial > listCarCategory = iCarCommerialService.listCarCommercialByCategory( );
|
|
|
+ if (listCarCategory != null && !"".equals(listCarCategory)) {
|
|
|
am.setIs(true);
|
|
|
am.setData(listCarCategory);
|
|
|
}
|
|
@@ -521,15 +587,16 @@ public class SupplierAdminController {
|
|
|
|
|
|
/**
|
|
|
* 根据车类查询品牌
|
|
|
+ *
|
|
|
* @param type
|
|
|
* @return
|
|
|
*/
|
|
|
@ResponseBody
|
|
|
@RequestMapping("listCarCommercialBrand.html")
|
|
|
- public AjaxMessage<Object> listCarCommercialBrand (String type){
|
|
|
- AjaxMessage<Object> am = new AjaxMessage<>();
|
|
|
- List<CarCommercial> listCarBrand = iCarCommerialService.listCarCommercialByBrand(type,"");
|
|
|
- if (listCarBrand != null && !"".equals(listCarBrand)){
|
|
|
+ public AjaxMessage< Object > listCarCommercialBrand(String type) {
|
|
|
+ AjaxMessage< Object > am = new AjaxMessage<>( );
|
|
|
+ List< CarCommercial > listCarBrand = iCarCommerialService.listCarCommercialByBrand(type, "");
|
|
|
+ if (listCarBrand != null && !"".equals(listCarBrand)) {
|
|
|
am.setIs(true);
|
|
|
am.setData(listCarBrand);
|
|
|
}
|
|
@@ -538,26 +605,27 @@ public class SupplierAdminController {
|
|
|
|
|
|
/**
|
|
|
* 跳转到数据导入界面
|
|
|
+ *
|
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping("supplierExcel.html")
|
|
|
- public ModelAndView providerExcel(){
|
|
|
- return new ModelAndView();
|
|
|
+ public ModelAndView providerExcel( ) {
|
|
|
+ return new ModelAndView( );
|
|
|
}
|
|
|
|
|
|
@ResponseBody
|
|
|
@RequestMapping("supplierExcelIn.html")
|
|
|
- public AjaxMessage<Object> providerExcelIn(String url, HttpServletRequest request) throws IOException {
|
|
|
+ public AjaxMessage< Object > providerExcelIn(String url, HttpServletRequest request) throws IOException {
|
|
|
|
|
|
System.err.println("url:" + url);
|
|
|
|
|
|
- Date begindata = new Date();
|
|
|
+ Date begindata = new Date( );
|
|
|
|
|
|
- String contextPath = request.getSession().getServletContext().getContextPath();
|
|
|
+ String contextPath = request.getSession( ).getServletContext( ).getContextPath( );
|
|
|
|
|
|
- List<Provider> list = new ArrayList<Provider>();
|
|
|
+ List< Provider > list = new ArrayList< Provider >( );
|
|
|
|
|
|
- if(url.endsWith(".xls")){
|
|
|
+ if (url.endsWith(".xls")) {
|
|
|
//2003版本的excel,用.xls结尾
|
|
|
|
|
|
InputStream is = new FileInputStream(url);
|
|
@@ -568,14 +636,14 @@ public class SupplierAdminController {
|
|
|
|
|
|
HSSFSheet hssfSheet = hssfWorkbook.getSheetAt(0);
|
|
|
|
|
|
- for (int rowNum = 1; rowNum <= hssfSheet.getLastRowNum(); rowNum++) {
|
|
|
+ for (int rowNum = 1; rowNum <= hssfSheet.getLastRowNum( ); rowNum++) {
|
|
|
HSSFRow hssfRow = (HSSFRow) hssfSheet.getRow(rowNum);
|
|
|
//获取表格数据
|
|
|
if (hssfRow != null) {
|
|
|
- Provider provider = new Provider();
|
|
|
+ Provider provider = new Provider( );
|
|
|
try {
|
|
|
provider.setCompanyName(String.valueOf(getValue(hssfRow.getCell(0))));
|
|
|
- }catch (Exception e){
|
|
|
+ } catch (Exception e) {
|
|
|
provider.setCompanyName(""); //出错默认为空
|
|
|
}
|
|
|
provider.setName(getValue(hssfRow.getCell(1)));
|
|
@@ -596,14 +664,14 @@ public class SupplierAdminController {
|
|
|
|
|
|
|
|
|
provider.setIsUse("1");
|
|
|
- provider.setEnterDate(new Date());
|
|
|
+ provider.setEnterDate(new Date( ));
|
|
|
provider.setStatus("0");
|
|
|
provider.setIsHot("0");
|
|
|
provider.setPhotos("0张");
|
|
|
provider.setServiceItem("0条");
|
|
|
provider.setPv(0);
|
|
|
- provider.setCreateDate(new Date());
|
|
|
- provider.setModifiedDate(new Date());
|
|
|
+ provider.setCreateDate(new Date( ));
|
|
|
+ provider.setModifiedDate(new Date( ));
|
|
|
provider.setRoleType("2");
|
|
|
provider.setIsUse("0");
|
|
|
provider.setLatitude("0");
|
|
@@ -613,7 +681,7 @@ public class SupplierAdminController {
|
|
|
list.add(provider);
|
|
|
}
|
|
|
}
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
FileInputStream fis = new FileInputStream(url);
|
|
|
//2007版本的excel,用.xlsx结尾
|
|
|
Workbook wookbook = new XSSFWorkbook(fis);//得到工作簿
|
|
@@ -621,17 +689,16 @@ public class SupplierAdminController {
|
|
|
//得到一个工作表
|
|
|
Sheet sheet = wookbook.getSheetAt(0);
|
|
|
//获得数据的总行数
|
|
|
- int totalRowNum = sheet.getLastRowNum();
|
|
|
+ int totalRowNum = sheet.getLastRowNum( );
|
|
|
//获得所有数据
|
|
|
- for(int i = 1 ; i < totalRowNum ; i++)
|
|
|
- {
|
|
|
+ for (int i = 1; i < totalRowNum; i++) {
|
|
|
//获得第i行对象
|
|
|
Row row = sheet.getRow(i);
|
|
|
//获取表格数据
|
|
|
- Provider provider = new Provider();
|
|
|
+ Provider provider = new Provider( );
|
|
|
try {
|
|
|
- provider.setCompanyName(String.valueOf(getValue(row.getCell((short)0))));
|
|
|
- }catch (Exception e){
|
|
|
+ provider.setCompanyName(String.valueOf(getValue(row.getCell((short) 0))));
|
|
|
+ } catch (Exception e) {
|
|
|
provider.setCompanyName(""); //出错默认null
|
|
|
}
|
|
|
provider.setName(getValue(row.getCell(1)));
|
|
@@ -651,14 +718,14 @@ public class SupplierAdminController {
|
|
|
provider.setTelphone(getValue(row.getCell(14)));
|
|
|
|
|
|
|
|
|
- provider.setEnterDate(new Date());
|
|
|
+ provider.setEnterDate(new Date( ));
|
|
|
provider.setStatus("0");
|
|
|
provider.setIsHot("0");
|
|
|
provider.setPhotos("0张");
|
|
|
provider.setServiceItem("0条");
|
|
|
provider.setPv(0);
|
|
|
- provider.setCreateDate(new Date());
|
|
|
- provider.setModifiedDate(new Date());
|
|
|
+ provider.setCreateDate(new Date( ));
|
|
|
+ provider.setModifiedDate(new Date( ));
|
|
|
provider.setRoleType("2");
|
|
|
provider.setIsUse("0");
|
|
|
provider.setLatitude("0");
|
|
@@ -669,87 +736,87 @@ public class SupplierAdminController {
|
|
|
}
|
|
|
}
|
|
|
//批量导入数据
|
|
|
- if(list.size()!=0){
|
|
|
- for (int i = 0; i < list.size() / 400 + 1; i++) {
|
|
|
+ if (list.size( ) != 0) {
|
|
|
+ for (int i = 0; i < list.size( ) / 400 + 1; i++) {
|
|
|
int end = (i + 1) * 400;
|
|
|
- if (end >= list.size()) {
|
|
|
- end = list.size();
|
|
|
+ if (end >= list.size( )) {
|
|
|
+ end = list.size( );
|
|
|
}
|
|
|
- List<Provider> serviceList = list.subList(i * 400, end);
|
|
|
- if(serviceList != null && serviceList.size() > 0){
|
|
|
+ List< Provider > serviceList = list.subList(i * 400, end);
|
|
|
+ if (serviceList != null && serviceList.size( ) > 0) {
|
|
|
iProviderService.addByList(serviceList);
|
|
|
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- Date endtime = new Date();
|
|
|
- System.err.println("耗时:"+(endtime.getTime()-begindata.getTime()));
|
|
|
- AjaxMessage<Object> ajax = new AjaxMessage<>();
|
|
|
+ Date endtime = new Date( );
|
|
|
+ System.err.println("耗时:" + (endtime.getTime( ) - begindata.getTime( )));
|
|
|
+ AjaxMessage< Object > ajax = new AjaxMessage<>( );
|
|
|
//删除重复的
|
|
|
- List<String> repeatList = iProviderService.queryId();
|
|
|
+ List< String > repeatList = iProviderService.queryId( );
|
|
|
iProviderService.deleteByRepeat(repeatList);
|
|
|
return ajax;
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
- @SuppressWarnings({ "static-access" })
|
|
|
- public static String getValue(Cell cell) {
|
|
|
+ @SuppressWarnings({"static-access"})
|
|
|
+ public static String getValue(Cell cell) {
|
|
|
String value = "";
|
|
|
- if(null==cell){
|
|
|
+ if (null == cell) {
|
|
|
return value;
|
|
|
}
|
|
|
- switch (cell.getCellType()) {
|
|
|
+ switch (cell.getCellType( )) {
|
|
|
//数值型
|
|
|
case Cell.CELL_TYPE_NUMERIC:
|
|
|
if (HSSFDateUtil.isCellDateFormatted(cell)) {// 处理日期格式、时间格式
|
|
|
SimpleDateFormat sdf = null;
|
|
|
- if (cell.getCellStyle().getDataFormat() == HSSFDataFormat
|
|
|
+ if (cell.getCellStyle( ).getDataFormat( ) == HSSFDataFormat
|
|
|
.getBuiltinFormat("h:mm")) {
|
|
|
sdf = new SimpleDateFormat("HH:mm");
|
|
|
} else {// 日期
|
|
|
sdf = new SimpleDateFormat("yyyy/MM/dd");
|
|
|
}
|
|
|
- Date date = cell.getDateCellValue();
|
|
|
- value= sdf.format(date);
|
|
|
+ Date date = cell.getDateCellValue( );
|
|
|
+ value = sdf.format(date);
|
|
|
break;
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
|
|
|
- value = String.valueOf(cell.getNumericCellValue());
|
|
|
+ value = String.valueOf(cell.getNumericCellValue( ));
|
|
|
|
|
|
- String isdouble[]=value.split("\\.");
|
|
|
- if(value.length()>3){
|
|
|
+ String isdouble[] = value.split("\\.");
|
|
|
+ if (value.length( ) > 3) {
|
|
|
DecimalFormat df = new DecimalFormat("0");
|
|
|
- String whatYourWant = df.format(cell.getNumericCellValue());
|
|
|
- value=whatYourWant;
|
|
|
- }else if(isdouble.length>1){
|
|
|
- if("0".equals(isdouble[1])){
|
|
|
+ String whatYourWant = df.format(cell.getNumericCellValue( ));
|
|
|
+ value = whatYourWant;
|
|
|
+ } else if (isdouble.length > 1) {
|
|
|
+ if ("0".equals(isdouble[1])) {
|
|
|
DecimalFormat df = new DecimalFormat("0");
|
|
|
- String whatYourWant = df.format(cell.getNumericCellValue());
|
|
|
- value=whatYourWant;
|
|
|
- }else{
|
|
|
+ String whatYourWant = df.format(cell.getNumericCellValue( ));
|
|
|
+ value = whatYourWant;
|
|
|
+ } else {
|
|
|
double d = Double.valueOf(value);
|
|
|
- d=getdouble(d);
|
|
|
- value= Double.toString(d);
|
|
|
+ d = getdouble(d);
|
|
|
+ value = Double.toString(d);
|
|
|
}
|
|
|
}
|
|
|
break;
|
|
|
}
|
|
|
//字符串类型
|
|
|
case Cell.CELL_TYPE_STRING:
|
|
|
- value = cell.getStringCellValue().toString();
|
|
|
+ value = cell.getStringCellValue( ).toString( );
|
|
|
break;
|
|
|
// 公式类型
|
|
|
case Cell.CELL_TYPE_FORMULA:
|
|
|
//读公式计算值
|
|
|
- value = String.valueOf(cell.getNumericCellValue());
|
|
|
+ value = String.valueOf(cell.getNumericCellValue( ));
|
|
|
if (value.equals("NaN")) {// 如果获取的数据值为非法值,则转换为获取字符串
|
|
|
- value = cell.getStringCellValue().toString();
|
|
|
+ value = cell.getStringCellValue( ).toString( );
|
|
|
}
|
|
|
break;
|
|
|
// 布尔类型
|
|
|
case Cell.CELL_TYPE_BOOLEAN:
|
|
|
- value = " "+ cell.getBooleanCellValue();
|
|
|
+ value = " " + cell.getBooleanCellValue( );
|
|
|
break;
|
|
|
// 空值
|
|
|
case Cell.CELL_TYPE_BLANK:
|
|
@@ -761,18 +828,18 @@ public class SupplierAdminController {
|
|
|
value = "";
|
|
|
break;
|
|
|
default:
|
|
|
- value = cell.getStringCellValue().toString();
|
|
|
+ value = cell.getStringCellValue( ).toString( );
|
|
|
}
|
|
|
- if("null".endsWith(value.trim())){
|
|
|
- value="";
|
|
|
+ if ("null".endsWith(value.trim( ))) {
|
|
|
+ value = "";
|
|
|
}
|
|
|
return value;
|
|
|
}
|
|
|
|
|
|
|
|
|
- public static double getdouble(double d){
|
|
|
- BigDecimal b = new BigDecimal(d);
|
|
|
- double f1 = b.setScale(1, BigDecimal.ROUND_HALF_UP).doubleValue();
|
|
|
+ public static double getdouble(double d) {
|
|
|
+ BigDecimal b = new BigDecimal(d);
|
|
|
+ double f1 = b.setScale(1, BigDecimal.ROUND_HALF_UP).doubleValue( );
|
|
|
return f1;
|
|
|
}
|
|
|
|