|
|
@@ -1,6 +1,6 @@
|
|
|
package com.goafanti.admin.service.impl;
|
|
|
|
|
|
-import java.math.BigDecimal;
|
|
|
+
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.Date;
|
|
|
import java.util.HashMap;
|
|
|
@@ -66,10 +66,14 @@ public class BusinessProjectServiceImpl extends BaseMybatisDao<BusinessProjectMa
|
|
|
if (pSize == null || pSize < 0 || pSize > 10) {
|
|
|
pSize = 10;
|
|
|
}
|
|
|
-
|
|
|
- return (Pagination<BusinessProjectBo>)findPage("findProjectListByPage", "findProjectListCount",
|
|
|
+ Pagination<BusinessProjectBo> pt=(Pagination<BusinessProjectBo>)findPage("findProjectListByPage", "findProjectListCount",
|
|
|
disposeParams(bname, cid, country, province, city, district, activityFlag,
|
|
|
status),pNo,pSize);
|
|
|
+ List<BusinessProjectBo> list=(List<BusinessProjectBo>) pt.getList();
|
|
|
+ for (BusinessProjectBo o : list) {
|
|
|
+ o.setCname(getAllCname(o.getCid()));
|
|
|
+ }
|
|
|
+ return pt;
|
|
|
}
|
|
|
private Map<String, Object> disposeParams(String bname, String cid, String country,String province,String city,String district, String activityFlag,
|
|
|
String status) {
|
|
|
@@ -134,9 +138,7 @@ public class BusinessProjectServiceImpl extends BaseMybatisDao<BusinessProjectMa
|
|
|
BusinessProjectBo bpo=new BusinessProjectBo();
|
|
|
BeanUtils.copyProperties(bp,bpo);
|
|
|
String cname=getAllCname(bpo.getCid());
|
|
|
- System.out.println("----------------"+bpo.getCid());
|
|
|
String createId=bpo.getCreateId();
|
|
|
- System.out.println(createId);
|
|
|
bpo.setCreateName(businessProjectMapper.getCreateName(createId));
|
|
|
bpo.setCname(cname);
|
|
|
return bpo;
|
|
|
@@ -173,30 +175,9 @@ public class BusinessProjectServiceImpl extends BaseMybatisDao<BusinessProjectMa
|
|
|
return cid.length()>3?cname:"";
|
|
|
}
|
|
|
}
|
|
|
- @Override
|
|
|
- public int updateAddOffset(String id) {
|
|
|
- BusinessProject bp=businessProjectMapper.selectByPrimaryKey(id);
|
|
|
- if (null==bp.getOffset()) {
|
|
|
- bp.setOffset(new BigDecimal(1));
|
|
|
- }
|
|
|
- if (bp.getOffset().compareTo(new BigDecimal(1))==-1) {
|
|
|
- bp.setOffset(bp.getOffset().add(new BigDecimal(0.01)));
|
|
|
- }
|
|
|
-
|
|
|
- return businessProjectMapper.updateByPrimaryKey(bp);
|
|
|
- }
|
|
|
|
|
|
- @Override
|
|
|
- public int updateSubtractOffset(String id) {
|
|
|
- BusinessProject bp=businessProjectMapper.selectByPrimaryKey(id);
|
|
|
- if (null==bp.getOffset()) {
|
|
|
- bp.setOffset(new BigDecimal(1));
|
|
|
- }
|
|
|
- if (bp.getOffset().compareTo(new BigDecimal(0))==1) {
|
|
|
- bp.setOffset(bp.getOffset().subtract(new BigDecimal(0.01)));
|
|
|
- }
|
|
|
- return businessProjectMapper.updateByPrimaryKey(bp);
|
|
|
- }
|
|
|
+
|
|
|
+
|
|
|
@Override
|
|
|
public int updateProject(BusinessProject s) {
|
|
|
BusinessProject bp=businessProjectMapper.selectByPrimaryKey(s.getId());
|
|
|
@@ -271,6 +252,7 @@ public class BusinessProjectServiceImpl extends BaseMybatisDao<BusinessProjectMa
|
|
|
public int updateOrgProjectSize(ProjectSize ps) {
|
|
|
ProjectSize psz=projectSizeMapper.selectByPrimaryKey(ps.getId());
|
|
|
projectSizeConfiguration(ps, psz);
|
|
|
+ System.out.println(psz);
|
|
|
return projectSizeMapper.updateByPrimaryKeySelective(psz);
|
|
|
}
|
|
|
private void projectSizeConfiguration(ProjectSize ps, ProjectSize psz) {
|
|
|
@@ -298,10 +280,57 @@ public class BusinessProjectServiceImpl extends BaseMybatisDao<BusinessProjectMa
|
|
|
if (null!=(ps.getStatus())) {
|
|
|
psz.setStatus(ps.getStatus());
|
|
|
}
|
|
|
+ psz.setUpdateTime(new Date());
|
|
|
}
|
|
|
-
|
|
|
- /*public ProjectSizeBo orgProjectSize(String id) {
|
|
|
+ @SuppressWarnings("unchecked")
|
|
|
+ @Override
|
|
|
+ public Pagination<ProjectSizeBo> listProjectSize(String pid,Integer pNo,Integer pSize) {
|
|
|
+ if (pNo == null || pNo < 0) {
|
|
|
+ pNo = 1;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (pSize == null || pSize < 0 || pSize > 10) {
|
|
|
+ pSize = 10;
|
|
|
+ }
|
|
|
+ Map<String, Object>map=new HashMap<>();
|
|
|
+ map.put("pid", pid);
|
|
|
+
|
|
|
+
|
|
|
+ Pagination<ProjectSizeBo> pt=(Pagination<ProjectSizeBo>)findPage("findProjectSizeListByPage", "findProjectSizeListCount",
|
|
|
+ map,pNo,pSize);
|
|
|
+ return pt;
|
|
|
+ }
|
|
|
+ @Override
|
|
|
+ public ProjectSizeBo getProjectSize(String id) {
|
|
|
+ return projectSizeMapper.selectByBusinessId(id);
|
|
|
+ }
|
|
|
+ @Override
|
|
|
+ public int deleteProjectSize(String id) {
|
|
|
|
|
|
- return null;
|
|
|
- }*/
|
|
|
+ return projectSizeMapper.deleteByPrimaryKey(id);
|
|
|
+ }
|
|
|
+ @Override
|
|
|
+ public int updateSotpProjectSize(String id) {
|
|
|
+ ProjectSize ps=projectSizeMapper.selectByPrimaryKey(id);
|
|
|
+ int i=ps.getStatus();
|
|
|
+ if (i==0) {
|
|
|
+ ps.setStatus(1);
|
|
|
+ }else {
|
|
|
+ ps.setStatus(0);
|
|
|
+ }
|
|
|
+ return projectSizeMapper.updateByPrimaryKey(ps);
|
|
|
+ }
|
|
|
+ @Override
|
|
|
+ public boolean WhetherRepeat(ProjectSize ps) {
|
|
|
+ List<ProjectSizeBo> list=projectSizeMapper.getgetPnamecount(ps.getPname());
|
|
|
+ if (null!=list&&list.isEmpty()) {
|
|
|
+ if (list.size()>1&&list.get(0).getPid().equals(ps.getPid())) {
|
|
|
+ System.out.println("true");
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
}
|