Просмотр исходного кода

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

release_toaliyun_real
luozukai 7 лет назад
Родитель
Сommit
069048a2ec
6 измененных файлов: 55 добавлений и 20 удалений
  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 Просмотреть файл

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

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


@GetMapping("list") @GetMapping("list")
@ApiImplicitParams({ @ApiImplicitParams({
@@ -59,7 +64,11 @@ public class WxRentContractController extends BaseController {
public ResultData add(@RequestBody WxRentContract wxRentContract) { public ResultData add(@RequestBody WxRentContract wxRentContract) {
logger.debug("[" + getIpAddr() + "] WxRentContractController::add"); logger.debug("[" + getIpAddr() + "] WxRentContractController::add");
wxRentContract.setTenantId(getTenantId()); 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()); wxRentContract.setAdjustPeriod(wxRentContract.getMonthHandleType());
} }
return wxRentContractService.save(wxRentContract, getUser().getId(),getUser().getName()); return wxRentContractService.save(wxRentContract, getUser().getId(),getUser().getName());
@@ -70,7 +79,10 @@ public class WxRentContractController extends BaseController {
public ResultData update(@RequestBody WxRentContract wxRentContract) { public ResultData update(@RequestBody WxRentContract wxRentContract) {
logger.debug("[" + getIpAddr() + "] WxRentContractController::update"); logger.debug("[" + getIpAddr() + "] WxRentContractController::update");
wxRentContract.setTenantId(getTenantId()); 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()); wxRentContract.setAdjustPeriod(wxRentContract.getMonthHandleType());
} }
return wxRentContractService.update(wxRentContract, getUser().getId(),getUser().getName()); return wxRentContractService.update(wxRentContract, getUser().getId(),getUser().getName());
@@ -81,7 +93,10 @@ public class WxRentContractController extends BaseController {
public ResultData updateMoney(@RequestBody WxRentContract wxRentContract) { public ResultData updateMoney(@RequestBody WxRentContract wxRentContract) {
logger.debug("[" + getIpAddr() + "] WxRentContractController::updateMoney"); logger.debug("[" + getIpAddr() + "] WxRentContractController::updateMoney");
wxRentContract.setTenantId(getTenantId()); 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()); wxRentContract.setAdjustPeriod(wxRentContract.getMonthHandleType());
} }
return wxRentContractService.update(wxRentContract, getUser().getId(),getUser().getName()); return wxRentContractService.update(wxRentContract, getUser().getId(),getUser().getName());
@@ -92,7 +107,10 @@ public class WxRentContractController extends BaseController {
public ResultData updateFile(@RequestBody WxRentContract wxRentContract) { public ResultData updateFile(@RequestBody WxRentContract wxRentContract) {
logger.debug("[" + getIpAddr() + "] WxRentContractController::updateFile"); logger.debug("[" + getIpAddr() + "] WxRentContractController::updateFile");
wxRentContract.setTenantId(getTenantId()); 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()); wxRentContract.setAdjustPeriod(wxRentContract.getMonthHandleType());
} }
return wxRentContractService.updateFile(wxRentContract, getUser().getId(),getUser().getName()); return wxRentContractService.updateFile(wxRentContract, getUser().getId(),getUser().getName());


+ 2
- 0
mallinkService/src/main/java/com/iformall/mapper/WxRentContractMapper.java Просмотреть файл

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


int hasContractNumber(WxRentContract wxRentContract); int hasContractNumber(WxRentContract wxRentContract);


Integer getShopType(WxRentContract wxRentContract);

} }

+ 1
- 0
mallinkService/src/main/java/com/iformall/service/WxRentContractService.java Просмотреть файл

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


ResultData hasContractNumber(WxRentContract wxRentContract); ResultData hasContractNumber(WxRentContract wxRentContract);


Integer getShopType(WxRentContract wxRentContract);
} }

+ 1
- 1
mallinkService/src/main/java/com/iformall/service/impl/WxPropertyContractServiceImpl.java Просмотреть файл

@@ -309,7 +309,7 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService
wxPropertyContract.setDeposit(record.getDeposit()); wxPropertyContract.setDeposit(record.getDeposit());
wxPropertyContract.setReceivePeriod(record.getReceivePeriod()); wxPropertyContract.setReceivePeriod(record.getReceivePeriod());
wxPropertyContract.setPayAccount(record.getPayAccount()); 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); record.setPreviewBillRentList(billList);
} }
} }


+ 23
- 14
mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java Просмотреть файл

@@ -13,10 +13,7 @@ import com.iformall.domain.po.*;
import com.iformall.enums.*; import com.iformall.enums.*;
import com.iformall.exception.MallinkException; import com.iformall.exception.MallinkException;
import com.iformall.mapper.*; 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.Constant;
import com.iformall.utils.DateUtils; import com.iformall.utils.DateUtils;
import org.apache.commons.collections.map.HashedMap; import org.apache.commons.collections.map.HashedMap;
@@ -98,6 +95,8 @@ public class WxRentContractServiceImpl implements WxRentContractService {


@Autowired @Autowired
WxMerchantShopMapper wxMerchantShopMapper; WxMerchantShopMapper wxMerchantShopMapper;
@Autowired
WxShopService wxShopService;


@Override @Override
public Map<String, Object> listAsPage(WxRentContract record, Integer pageIndex, Integer pageSize) { 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.setPrice(wxRentContract.getPrice() != null ? wxRentContract.getPrice() : 0);
wxRentContract.setDeposit(wxRentContract.getDeposit() != null ? wxRentContract.getDeposit() : 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); result.put("wxRentContract", wxRentContract);
//关联的商户 //关联的商户
if (wxRentContract.getMerchantId() != null) { if (wxRentContract.getMerchantId() != null) {
@@ -2032,6 +2037,10 @@ public class WxRentContractServiceImpl implements WxRentContractService {
wxRentContractMapper.updateApplyStatus(wxRentContract); wxRentContractMapper.updateApplyStatus(wxRentContract);
} }


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





+ 5
- 0
mallinkService/src/main/resources/mapper/WxRentContractMapper.xml Просмотреть файл

@@ -271,5 +271,10 @@
</where> </where>
</select> </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> </mapper>

Загрузка…
Отмена
Сохранить