Browse Source

[审批流][修改][修改预览账单生成逻辑]

release_toaliyun_real
luozukai 7 years ago
parent
commit
069048a2ec
6 changed files with 55 additions and 20 deletions
  1. +23
    -5
      mallinkAdmin/src/main/java/com/iformall/controller/WxRentContractController.java
  2. +2
    -0
      mallinkService/src/main/java/com/iformall/mapper/WxRentContractMapper.java
  3. +1
    -0
      mallinkService/src/main/java/com/iformall/service/WxRentContractService.java
  4. +1
    -1
      mallinkService/src/main/java/com/iformall/service/impl/WxPropertyContractServiceImpl.java
  5. +23
    -14
      mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java
  6. +5
    -0
      mallinkService/src/main/resources/mapper/WxRentContractMapper.xml

+ 23
- 5
mallinkAdmin/src/main/java/com/iformall/controller/WxRentContractController.java View File

@@ -7,9 +7,13 @@ import com.iformall.common.ResultData;
import com.iformall.domain.po.WxBillRent;
import com.iformall.domain.po.WxPayAccountBill;
import com.iformall.domain.po.WxRentContract;
import com.iformall.domain.po.WxShop;
import com.iformall.enums.EnumRentShopType;
import com.iformall.enums.EnumShopType;
import com.iformall.service.WxBillRentService;
import com.iformall.service.WxPayAccountBillService;
import com.iformall.service.WxRentContractService;
import com.iformall.service.WxShopService;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import org.apache.commons.lang3.StringUtils;
@@ -35,9 +39,10 @@ public class WxRentContractController extends BaseController {
private WxRentContractService wxRentContractService;
@Autowired
private WxBillRentService wxBillRentService;

@Autowired
private WxPayAccountBillService payAccountBillService;
@Autowired
private WxShopService wxShopService;

@GetMapping("list")
@ApiImplicitParams({
@@ -59,7 +64,11 @@ public class WxRentContractController extends BaseController {
public ResultData add(@RequestBody WxRentContract wxRentContract) {
logger.debug("[" + getIpAddr() + "] WxRentContractController::add");
wxRentContract.setTenantId(getTenantId());
if(wxRentContract.getMonthHandleType() != null){

//目前只有多经点位租赁合同
WxShop wxShop = wxShopService.getById(wxRentContract.getShopId());
if(wxRentContract.getMonthHandleType() != null && wxRentContract.getMonthHandleType().intValue()==3
&& EnumRentShopType.POINT.getCode().equals(wxShop.getType())){
wxRentContract.setAdjustPeriod(wxRentContract.getMonthHandleType());
}
return wxRentContractService.save(wxRentContract, getUser().getId(),getUser().getName());
@@ -70,7 +79,10 @@ public class WxRentContractController extends BaseController {
public ResultData update(@RequestBody WxRentContract wxRentContract) {
logger.debug("[" + getIpAddr() + "] WxRentContractController::update");
wxRentContract.setTenantId(getTenantId());
if(wxRentContract.getMonthHandleType() != null){
//目前只有多经点位租赁合同
WxShop wxShop = wxShopService.getById(wxRentContract.getShopId());
if(wxRentContract.getMonthHandleType() != null && wxRentContract.getMonthHandleType().intValue()==3
&& EnumRentShopType.POINT.getCode().equals(wxShop.getType())){
wxRentContract.setAdjustPeriod(wxRentContract.getMonthHandleType());
}
return wxRentContractService.update(wxRentContract, getUser().getId(),getUser().getName());
@@ -81,7 +93,10 @@ public class WxRentContractController extends BaseController {
public ResultData updateMoney(@RequestBody WxRentContract wxRentContract) {
logger.debug("[" + getIpAddr() + "] WxRentContractController::updateMoney");
wxRentContract.setTenantId(getTenantId());
if(wxRentContract.getMonthHandleType() != null){
//目前只有多经点位租赁合同
WxShop wxShop = wxShopService.getById(wxRentContract.getShopId());
if(wxRentContract.getMonthHandleType() != null && wxRentContract.getMonthHandleType().intValue()==3
&& EnumRentShopType.POINT.getCode().equals(wxShop.getType())){
wxRentContract.setAdjustPeriod(wxRentContract.getMonthHandleType());
}
return wxRentContractService.update(wxRentContract, getUser().getId(),getUser().getName());
@@ -92,7 +107,10 @@ public class WxRentContractController extends BaseController {
public ResultData updateFile(@RequestBody WxRentContract wxRentContract) {
logger.debug("[" + getIpAddr() + "] WxRentContractController::updateFile");
wxRentContract.setTenantId(getTenantId());
if(wxRentContract.getMonthHandleType() != null){
//目前只有多经点位租赁合同
WxShop wxShop = wxShopService.getById(wxRentContract.getShopId());
if(wxRentContract.getMonthHandleType() != null && wxRentContract.getMonthHandleType().intValue()==3
&& EnumRentShopType.POINT.getCode().equals(wxShop.getType())){
wxRentContract.setAdjustPeriod(wxRentContract.getMonthHandleType());
}
return wxRentContractService.updateFile(wxRentContract, getUser().getId(),getUser().getName());


+ 2
- 0
mallinkService/src/main/java/com/iformall/mapper/WxRentContractMapper.java View File

@@ -57,4 +57,6 @@ public interface WxRentContractMapper extends CommonMapper<WxRentContract, Long>

int hasContractNumber(WxRentContract wxRentContract);

Integer getShopType(WxRentContract wxRentContract);

}

+ 1
- 0
mallinkService/src/main/java/com/iformall/service/WxRentContractService.java View File

@@ -83,4 +83,5 @@ public interface WxRentContractService {

ResultData hasContractNumber(WxRentContract wxRentContract);

Integer getShopType(WxRentContract wxRentContract);
}

+ 1
- 1
mallinkService/src/main/java/com/iformall/service/impl/WxPropertyContractServiceImpl.java View File

@@ -309,7 +309,7 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService
wxPropertyContract.setDeposit(record.getDeposit());
wxPropertyContract.setReceivePeriod(record.getReceivePeriod());
wxPropertyContract.setPayAccount(record.getPayAccount());
billList = buildProperty(new WxMerchant(),userId,wxPropertyContract,EnumIsPreview.YES.getCode());
billList = buildProperty(new WxMerchant(),userId,record,EnumIsPreview.YES.getCode());
record.setPreviewBillRentList(billList);
}
}


+ 23
- 14
mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java View File

@@ -13,10 +13,7 @@ import com.iformall.domain.po.*;
import com.iformall.enums.*;
import com.iformall.exception.MallinkException;
import com.iformall.mapper.*;
import com.iformall.service.WxFlowRecordService;
import com.iformall.service.WxFlowService;
import com.iformall.service.WxMerchantService;
import com.iformall.service.WxRentContractService;
import com.iformall.service.*;
import com.iformall.utils.Constant;
import com.iformall.utils.DateUtils;
import org.apache.commons.collections.map.HashedMap;
@@ -98,6 +95,8 @@ public class WxRentContractServiceImpl implements WxRentContractService {

@Autowired
WxMerchantShopMapper wxMerchantShopMapper;
@Autowired
WxShopService wxShopService;

@Override
public Map<String, Object> listAsPage(WxRentContract record, Integer pageIndex, Integer pageSize) {
@@ -127,17 +126,23 @@ public class WxRentContractServiceImpl implements WxRentContractService {
}
wxRentContract.setPrice(wxRentContract.getPrice() != null ? wxRentContract.getPrice() : 0);
wxRentContract.setDeposit(wxRentContract.getDeposit() != null ? wxRentContract.getDeposit() : 0);
//handle adjustPeriod 1日 2月 monthHandleType 2按账单周期 3按自然月
if(wxRentContract.getAdjustPeriod().intValue() == 1){
wxRentContract.setAdjustPeriod(1);
wxRentContract.setMonthHandleType(null);
}else if(wxRentContract.getAdjustPeriod().intValue() == 2){
wxRentContract.setAdjustPeriod(2);
wxRentContract.setMonthHandleType(2);
}else if(wxRentContract.getAdjustPeriod().intValue() == 3){
wxRentContract.setAdjustPeriod(2);
wxRentContract.setMonthHandleType(3);

//目前只有多经点位租赁合同
WxShop wxShop = wxShopService.getById(wxRentContract.getShopId());
if(EnumRentShopType.POINT.getCode().equals(wxShop.getType())){
//handle adjustPeriod 1日 2月 monthHandleType 2按账单周期 3按自然月
if(wxRentContract.getAdjustPeriod().intValue() == 1){
wxRentContract.setAdjustPeriod(1);
wxRentContract.setMonthHandleType(null);
}else if(wxRentContract.getAdjustPeriod().intValue() == 2){
wxRentContract.setAdjustPeriod(2);
wxRentContract.setMonthHandleType(2);
}else if(wxRentContract.getAdjustPeriod().intValue() == 3){
wxRentContract.setAdjustPeriod(2);
wxRentContract.setMonthHandleType(3);
}
}

result.put("wxRentContract", wxRentContract);
//关联的商户
if (wxRentContract.getMerchantId() != null) {
@@ -2032,6 +2037,10 @@ public class WxRentContractServiceImpl implements WxRentContractService {
wxRentContractMapper.updateApplyStatus(wxRentContract);
}

@Override
public Integer getShopType(WxRentContract wxRentContract) {
return wxRentContractMapper.getShopType(wxRentContract);
}
}



+ 5
- 0
mallinkService/src/main/resources/mapper/WxRentContractMapper.xml View File

@@ -271,5 +271,10 @@
</where>
</select>

<select id="getShopType" parameterType="com.iformall.domain.po.WxRentContract" resultType="int">
select s.type from wx_rent_contract r left join wx_shop s on(s.id = r.`shop_id`)
where r.id = #{id}
</select>


</mapper>

Loading…
Cancel
Save