|
|
@@ -42,6 +42,7 @@ import com.goafanti.user.bo.OrgIdentityBo;
|
|
|
import com.goafanti.user.bo.OrgIdentityDetailAdmin;
|
|
|
import com.goafanti.user.bo.OrgIdentityDetailBo;
|
|
|
import com.goafanti.user.bo.OrgUnitNames;
|
|
|
+import com.goafanti.user.bo.OrganizationIndentityUserBo;
|
|
|
import com.goafanti.user.service.OrganizationIdentityService;
|
|
|
|
|
|
@Service
|
|
|
@@ -71,6 +72,18 @@ public class OrganizationIdentityServiceImpl extends BaseMybatisDao<Organization
|
|
|
return organizationIdentityMapper.selectOrgIdentityByUserId(userId);
|
|
|
}
|
|
|
|
|
|
+ public OrganizationIndentityUserBo selectOrgIdentityUserBoByUserId(String userId) {
|
|
|
+ OrganizationIdentity oi = organizationIdentityMapper.selectOrgIdentityByUserId(userId);
|
|
|
+ OrgRatepay ratepay = orgRatepayMapper.selectRatepayByUidAndYear(userId,
|
|
|
+ Calendar.getInstance().get(Calendar.YEAR - 1));
|
|
|
+ OrganizationIndentityUserBo bo = new OrganizationIndentityUserBo();
|
|
|
+ BeanUtils.copyProperties(oi, bo);
|
|
|
+ if (null != ratepay) {
|
|
|
+ bo.setRatepayId(ratepay.getId());
|
|
|
+ }
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+
|
|
|
@Override
|
|
|
public int updateByPrimaryKeySelective(OrganizationIdentity organizationIdentity) {
|
|
|
return organizationIdentityMapper.updateByPrimaryKeySelective(organizationIdentity);
|
|
|
@@ -118,6 +131,9 @@ public class OrganizationIdentityServiceImpl extends BaseMybatisDao<Organization
|
|
|
@Override
|
|
|
public int saveOrgIndentityProcess(Result res, OrganizationIdentity o, String uid) {
|
|
|
OrganizationIdentity org = organizationIdentityMapper.selectOrgIdentityByUserId(uid);
|
|
|
+ if (StringUtils.isNotBlank(o.getLastYearTaxReportUrl())) {
|
|
|
+ disposeRatePay(o, uid);
|
|
|
+ }
|
|
|
if (null == org) {
|
|
|
o.setId(UUID.randomUUID().toString());
|
|
|
o.setUid(uid);
|
|
|
@@ -127,7 +143,7 @@ public class OrganizationIdentityServiceImpl extends BaseMybatisDao<Organization
|
|
|
if (null != o.getAuditStatus() && 5 == o.getAuditStatus()) {
|
|
|
User u = new User();
|
|
|
u.setId(uid);
|
|
|
- u.setLvl(1);
|
|
|
+ u.setLvl(UserLevel.CERTIFIED.getCode());
|
|
|
userMapper.updateByPrimaryKeySelective(u);
|
|
|
}
|
|
|
return organizationIdentityMapper.updateByPrimaryKeySelective(o);
|
|
|
@@ -136,21 +152,8 @@ public class OrganizationIdentityServiceImpl extends BaseMybatisDao<Organization
|
|
|
|
|
|
@Override
|
|
|
public int updateOrgDetail(OrganizationIdentity orgIdentity, String saveSign, Integer level) {
|
|
|
- if (null != orgIdentity.getLastYearTaxReportUrl()) {
|
|
|
- Calendar cal = Calendar.getInstance();
|
|
|
- OrgRatepay rate = orgRatepayMapper.selectRatepayByUidAndYear(orgIdentity.getUid(), Calendar.YEAR - 1);
|
|
|
- if (null == rate) {
|
|
|
- OrgRatepay r = new OrgRatepay();
|
|
|
- r.setId(UUID.randomUUID().toString());
|
|
|
- r.setUid(orgIdentity.getUid());
|
|
|
- r.setYear(cal.get(Calendar.YEAR) - 1);
|
|
|
- r.setDeletedSign(DeleteStatus.UNDELETE.getCode());
|
|
|
- r.setTaxReturnUrl(orgIdentity.getLastYearTaxReportUrl());
|
|
|
- orgRatepayMapper.insert(r);
|
|
|
- } else {
|
|
|
- rate.setTaxReturnUrl(orgIdentity.getLastYearTaxReportUrl());
|
|
|
- orgRatepayMapper.updateByPrimaryKeySelective(rate);
|
|
|
- }
|
|
|
+ if (StringUtils.isNotBlank(orgIdentity.getLastYearTaxReportUrl())) {
|
|
|
+ disposeRatePay(orgIdentity, orgIdentity.getUid());
|
|
|
}
|
|
|
User user = userMapper.selectByPrimaryKey(orgIdentity.getUid());
|
|
|
user.setLvl(level);
|
|
|
@@ -178,7 +181,7 @@ public class OrganizationIdentityServiceImpl extends BaseMybatisDao<Organization
|
|
|
user.setAid(aid);
|
|
|
user.setMid(mid);
|
|
|
userMapper.updateByPrimaryKeySelective(user);
|
|
|
- disposeRatePay(oi, oi.getUid());
|
|
|
+ // disposeRatePay(oi, oi.getUid());
|
|
|
createNotice(user, oi.getAuditStatus());
|
|
|
}
|
|
|
return organizationIdentityMapper.updateByPrimaryKeySelective(oi);
|
|
|
@@ -217,7 +220,9 @@ public class OrganizationIdentityServiceImpl extends BaseMybatisDao<Organization
|
|
|
|
|
|
@Override
|
|
|
public AuditorOrgIdentityDetailBo selectAuditorOrgIdentityDetailByUserId(String uid) {
|
|
|
- return organizationIdentityMapper.selectAuditorOrgIdentityDetailByUserId(uid);
|
|
|
+
|
|
|
+ return organizationIdentityMapper.selectAuditorOrgIdentityDetailByUserId(uid,
|
|
|
+ Calendar.getInstance().get(Calendar.YEAR - 1));
|
|
|
}
|
|
|
|
|
|
@SuppressWarnings("unchecked")
|
|
|
@@ -342,13 +347,18 @@ public class OrganizationIdentityServiceImpl extends BaseMybatisDao<Organization
|
|
|
OrgIdentityDetailAdmin bo = new OrgIdentityDetailAdmin();
|
|
|
BeanUtils.copyProperties(o, bo);
|
|
|
bo.setLevel(u.getLvl().toString());
|
|
|
+ Calendar now = Calendar.getInstance();
|
|
|
+ OrgRatepay ratepay = orgRatepayMapper.selectRatepayByUidAndYear(uid, now.get(Calendar.YEAR) - 1);
|
|
|
+ if (null != ratepay) {
|
|
|
+ bo.setRatepayId(ratepay.getId());
|
|
|
+ }
|
|
|
return bo;
|
|
|
}
|
|
|
|
|
|
private void disposeRatePay(OrganizationIdentity o, String uid) {
|
|
|
Calendar now = Calendar.getInstance();
|
|
|
- if (null != o.getLastYearTaxReportUrl()
|
|
|
- && null == orgRatepayMapper.selectRatepayByUidAndYear(uid, now.get(Calendar.YEAR) - 1)) {
|
|
|
+ OrgRatepay ratepay = orgRatepayMapper.selectRatepayByUidAndYear(uid, now.get(Calendar.YEAR) - 1);
|
|
|
+ if (null == ratepay) {
|
|
|
OrgRatepay r = new OrgRatepay();
|
|
|
r.setId(UUID.randomUUID().toString());
|
|
|
r.setUid(uid);
|
|
|
@@ -356,6 +366,9 @@ public class OrganizationIdentityServiceImpl extends BaseMybatisDao<Organization
|
|
|
r.setDeletedSign(DeleteStatus.UNDELETE.getCode());
|
|
|
r.setTaxReturnUrl(o.getLastYearTaxReportUrl());
|
|
|
orgRatepayMapper.insert(r);
|
|
|
+ } else {
|
|
|
+ ratepay.setTaxReturnUrl(o.getLastYearTaxReportUrl());
|
|
|
+ orgRatepayMapper.updateByPrimaryKeySelective(ratepay);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -371,10 +384,10 @@ public class OrganizationIdentityServiceImpl extends BaseMybatisDao<Organization
|
|
|
oi.setId(UUID.randomUUID().toString());
|
|
|
oi.setUid(TokenManager.getUserId());
|
|
|
organizationIdentityMapper.insert(oi);
|
|
|
- } else if (null != o && StringUtils.isNotBlank(oi.getId())){
|
|
|
+ } else if (null != o && StringUtils.isNotBlank(oi.getId())) {
|
|
|
organizationIdentityMapper.updateByPrimaryKeySelective(oi);
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
}
|
|
|
|
|
|
}
|