|
|
@@ -18,8 +18,10 @@ import com.goafanti.admin.service.BusinessProjectService;
|
|
|
|
|
|
import com.goafanti.common.dao.BusinessProjectMapper;
|
|
|
import com.goafanti.common.dao.BusinessVarietiesMapper;
|
|
|
+import com.goafanti.common.dao.ProjectSizeMapper;
|
|
|
import com.goafanti.common.model.BusinessProject;
|
|
|
import com.goafanti.common.model.BusinessVarieties;
|
|
|
+import com.goafanti.common.model.ProjectSize;
|
|
|
import com.goafanti.common.utils.StringUtils;
|
|
|
import com.goafanti.core.mybatis.BaseMybatisDao;
|
|
|
import com.goafanti.core.mybatis.page.Pagination;
|
|
|
@@ -30,6 +32,8 @@ public class BusinessProjectServiceImpl extends BaseMybatisDao<BusinessProjectMa
|
|
|
BusinessProjectMapper businessProjectMapper;
|
|
|
@Autowired
|
|
|
BusinessVarietiesMapper businessVarietiesMapper;
|
|
|
+ @Autowired
|
|
|
+ ProjectSizeMapper projectSizeMapper;
|
|
|
|
|
|
@Override
|
|
|
public int insert(String bname, String cid, String country, String province, String city, String district) {
|
|
|
@@ -126,10 +130,14 @@ public class BusinessProjectServiceImpl extends BaseMybatisDao<BusinessProjectMa
|
|
|
@Override
|
|
|
public BusinessProjectBo orgProject(String id) {
|
|
|
BusinessProject bp=businessProjectMapper.selectByPrimaryKey(id);
|
|
|
+
|
|
|
BusinessProjectBo bpo=new BusinessProjectBo();
|
|
|
BeanUtils.copyProperties(bp,bpo);
|
|
|
String cname=getAllCname(bpo.getCid());
|
|
|
- System.out.println(cname);
|
|
|
+ System.out.println("----------------"+bpo.getCid());
|
|
|
+ String createId=bpo.getCreateId();
|
|
|
+ System.out.println(createId);
|
|
|
+ bpo.setCreateName(businessProjectMapper.getCreateName(createId));
|
|
|
bpo.setCname(cname);
|
|
|
return bpo;
|
|
|
}
|
|
|
@@ -189,6 +197,108 @@ public class BusinessProjectServiceImpl extends BaseMybatisDao<BusinessProjectMa
|
|
|
}
|
|
|
return businessProjectMapper.updateByPrimaryKey(bp);
|
|
|
}
|
|
|
+ @Override
|
|
|
+ public int updateProject(BusinessProject s) {
|
|
|
+ BusinessProject bp=businessProjectMapper.selectByPrimaryKey(s.getId());
|
|
|
+ TheGinseng(s, bp);
|
|
|
+ return businessProjectMapper.updateByPrimaryKey(bp);
|
|
|
+ }
|
|
|
+ private void TheGinseng(BusinessProject s, BusinessProject bp) {
|
|
|
+
|
|
|
+ if (StringUtils.isNotBlank(s.getBname())) {
|
|
|
+ bp.setBname(s.getBname());
|
|
|
+ }
|
|
|
+ if (StringUtils.isNotBlank(s.getCid())) {
|
|
|
+ bp.setCid(s.getCid());
|
|
|
+ }
|
|
|
+ if (StringUtils.isNotBlank(s.getCountry())) {
|
|
|
+ bp.setCountry(s.getCountry());
|
|
|
+ }
|
|
|
+ if (StringUtils.isNotBlank(s.getProvince())) {
|
|
|
+ bp.setProvince(s.getProvince());
|
|
|
+ }
|
|
|
+ if (StringUtils.isNotBlank(s.getCity())) {
|
|
|
+ bp.setCity(s.getCity());
|
|
|
+ }
|
|
|
+ if (StringUtils.isNotBlank(s.getDistrict())) {
|
|
|
+ bp.setDistrict(s.getDistrict());
|
|
|
+ }
|
|
|
+ if (null!=s.getPrice()) {
|
|
|
+ bp.setPrice(s.getPrice());
|
|
|
+ }
|
|
|
+ if (null!=(s.getOffset())) {
|
|
|
+ bp.setOffset(s.getOffset());
|
|
|
+ }
|
|
|
+ if (null!=(s.getActivityFlag())) {
|
|
|
+ bp.setActivityFlag(s.getActivityFlag());
|
|
|
+ }
|
|
|
+ if (null!=(s.getMemberPrice())) {
|
|
|
+ bp.setMemberPrice(s.getMemberPrice());
|
|
|
+ }
|
|
|
+ if (null!=(s.getActivityPrice())) {
|
|
|
+ bp.setActivityPrice(s.getActivityPrice());
|
|
|
+ }
|
|
|
+ if (StringUtils.isNotBlank(s.getIntroduce())) {
|
|
|
+ bp.setIntroduce(s.getIntroduce());
|
|
|
+ }
|
|
|
+ if (StringUtils.isNotBlank(s.getValueEffect())) {
|
|
|
+ bp.setValueEffect(s.getValueEffect());
|
|
|
+ }
|
|
|
+ if (StringUtils.isNotBlank(s.getClientSize())) {
|
|
|
+ bp.setClientSize(s.getClientSize());
|
|
|
+ }
|
|
|
+ if (StringUtils.isNotBlank(s.getMinLogo())) {
|
|
|
+ bp.setMinLogo(s.getMinLogo());
|
|
|
+ }
|
|
|
+ if (StringUtils.isNotBlank(s.getMaxLogo())) {
|
|
|
+ bp.setMaxLogo(s.getMaxLogo());
|
|
|
+ }
|
|
|
+ if (null!=(s.getStatus())) {
|
|
|
+ bp.setStatus(s.getStatus());
|
|
|
+ }
|
|
|
+ bp.setUpdateTime(new Date());
|
|
|
+ }
|
|
|
+ @Override
|
|
|
+ public int addProjectSize(ProjectSize ps) {
|
|
|
+ ps.setId(UUID.randomUUID().toString());
|
|
|
+ //bp.setCreateId(TokenManager.getAdminId());
|
|
|
+ ps.setCreateId("f31c0d1a-05bc-4f5c-b4a8-95f983d24131");
|
|
|
+ ps.setCreateTime(new Date());
|
|
|
+ ps.setStatus(0);
|
|
|
+ return projectSizeMapper.insert(ps);
|
|
|
+ }
|
|
|
+ @Override
|
|
|
+ public int updateOrgProjectSize(ProjectSize ps) {
|
|
|
+ ProjectSize psz=projectSizeMapper.selectByPrimaryKey(ps.getId());
|
|
|
+ projectSizeConfiguration(ps, psz);
|
|
|
+ return projectSizeMapper.updateByPrimaryKeySelective(psz);
|
|
|
+ }
|
|
|
+ private void projectSizeConfiguration(ProjectSize ps, ProjectSize psz) {
|
|
|
+ if (StringUtils.isNotBlank(ps.getPid())) {
|
|
|
+ psz.setId(ps.getPid());
|
|
|
+ }
|
|
|
+ if (StringUtils.isNotBlank(ps.getPname())) {
|
|
|
+ psz.setPname(ps.getPname());
|
|
|
+ }
|
|
|
+ if (null!=ps.getPrice()) {
|
|
|
+ psz.setPrice(ps.getPrice());
|
|
|
+ }
|
|
|
+ if (null!=(ps.getOffset())) {
|
|
|
+ psz.setOffset(ps.getOffset());
|
|
|
+ }
|
|
|
+ if (null!=(ps.getActivityFlag())) {
|
|
|
+ psz.setActivityFlag(ps.getActivityFlag());
|
|
|
+ }
|
|
|
+ if (null!=(ps.getMemberPrice())) {
|
|
|
+ psz.setMemberPrice(ps.getMemberPrice());
|
|
|
+ }
|
|
|
+ if (null!=(ps.getActivityPrice())) {
|
|
|
+ psz.setActivityPrice(ps.getActivityPrice());
|
|
|
+ }
|
|
|
+ if (null!=(ps.getStatus())) {
|
|
|
+ psz.setStatus(ps.getStatus());
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
/*public ProjectSizeBo orgProjectSize(String id) {
|
|
|
|