|
@@ -13,6 +13,7 @@ import cn.com.ty.lift.common.utils.DateUtils;
|
|
|
import cn.com.xwy.boot.web.dto.RestResponse;
|
|
|
import cn.hutool.core.util.ObjectUtil;
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
@@ -23,6 +24,8 @@ import org.springframework.transaction.annotation.Transactional;
|
|
|
import org.springframework.transaction.interceptor.TransactionAspectSupport;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
+import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
|
|
|
/**
|
|
|
* @author bieao
|
|
@@ -120,7 +123,7 @@ public class ContractService extends ServiceImpl<ContractsMapper, Contracts> {
|
|
|
return RestResponse.fail(MessageUtils.get("msg.add.fail"));
|
|
|
}
|
|
|
//批量插入收款信息
|
|
|
- boolean ret = paymentService.insertBatch(extend.getPaymentList(), contracts.getCode());
|
|
|
+ boolean ret = paymentService.insertBatch(extend.getPaymentList(), contracts.getId());
|
|
|
if (!ret) {
|
|
|
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
|
|
return RestResponse.fail(MessageUtils.get("msg.add.batch.fail"));
|
|
@@ -169,7 +172,12 @@ public class ContractService extends ServiceImpl<ContractsMapper, Contracts> {
|
|
|
* @description 查看合同详情
|
|
|
* @date 2019/12/7 11:50 AM
|
|
|
*/
|
|
|
- public Contracts detail(Long id) {
|
|
|
- return contractsMapper.selectById(id);
|
|
|
+ public Map<String, Object> detail(Long id) {
|
|
|
+ QueryWrapper<Contracts> queryWrapper = new QueryWrapper<>();
|
|
|
+ queryWrapper.eq("id", id);
|
|
|
+ Map<String, Object> contractMap = getMap(queryWrapper);
|
|
|
+ List<Map<String, Object>> paymentMap = paymentService.paymentList(id);
|
|
|
+ contractMap.put("paymentList", paymentMap);
|
|
|
+ return contractMap;
|
|
|
}
|
|
|
}
|