|
@@ -3,6 +3,10 @@ package com.yh.saas.plugin.yiliangyiyun.service.impl;
|
|
|
import com.baomidou.mybatisplus.mapper.EntityWrapper;
|
|
|
import com.yh.saas.common.support.util.IdGenerator;
|
|
|
import com.yh.saas.plugin.yiliangyiyun.entity.ContractGoodsInfo;
|
|
|
+import com.google.common.collect.Lists;
|
|
|
+import com.winsea.svc.base.base.util.page.PageView;
|
|
|
+import com.winsea.svc.base.security.entity.User;
|
|
|
+import com.winsea.svc.base.security.util.AuthSecurityUtils;
|
|
|
import com.yh.saas.plugin.yiliangyiyun.entity.ContractManagementInfo;
|
|
|
import com.yh.saas.plugin.yiliangyiyun.entity.ContractProcessInfo;
|
|
|
import com.yh.saas.plugin.yiliangyiyun.mapper.ContractManagementInfoMapper;
|
|
@@ -12,8 +16,14 @@ import com.baomidou.mybatisplus.service.impl.ServiceImpl;
|
|
|
import com.yh.saas.plugin.yiliangyiyun.service.IContractProcessInfoService;
|
|
|
import com.yh.saas.plugin.yiliangyiyun.constant.StatusEnum;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.apache.xmlbeans.impl.xb.xsdschema.Public;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import com.baomidou.mybatisplus.plugins.Page;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
+
|
|
|
/**
|
|
|
* <p>
|
|
|
* 合同管理 服务实现类
|
|
@@ -85,15 +95,71 @@ public class ContractManagementInfoServiceImpl extends ServiceImpl<ContractManag
|
|
|
* @param id
|
|
|
* @return
|
|
|
*/
|
|
|
- public ContractManagementInfo getInfo(String id){
|
|
|
+ public ContractManagementInfo getInfo(String id) {
|
|
|
// 主表信息
|
|
|
ContractManagementInfo contractManagementInfo = this.selectById(id);
|
|
|
//货物信息
|
|
|
- ContractGoodsInfo contractGoodsInfo = contractGoodsInfoService.selectOne(new EntityWrapper<ContractGoodsInfo>().eq("contract_id",id));
|
|
|
+ ContractGoodsInfo contractGoodsInfo = contractGoodsInfoService.selectOne(new EntityWrapper<ContractGoodsInfo>().eq("contract_id", id));
|
|
|
//流程信息
|
|
|
- ContractProcessInfo contractProcessInfo = contractProcessInfoService.selectOne(new EntityWrapper<ContractProcessInfo>().eq("contract_id",id));
|
|
|
+ ContractProcessInfo contractProcessInfo = contractProcessInfoService.selectOne(new EntityWrapper<ContractProcessInfo>().eq("contract_id", id));
|
|
|
contractManagementInfo.setContractGoodsInfo(contractGoodsInfo);
|
|
|
contractManagementInfo.setContractProcessInfo(contractProcessInfo);
|
|
|
return contractManagementInfo;
|
|
|
}
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public Page<ContractManagementInfo> selectInfo(PageView pageView) {
|
|
|
+ // 状态类型(1未完成2已完成3待回款)
|
|
|
+ pageView.put("startRecord", (Integer.parseInt((String) pageView.get("currentPage")) - 1)
|
|
|
+ * Integer.parseInt((String) pageView.get("pageSize")));
|
|
|
+ // 公司ID
|
|
|
+ pageView.put("compId", AuthSecurityUtils.getCurrentUserInfo().getCompId());
|
|
|
+ // 查询服务商总数
|
|
|
+ Integer dataCount = baseMapper.getCountByCondition(pageView);
|
|
|
+ List<ContractManagementInfo> dataList = baseMapper.getListByCondition(pageView);
|
|
|
+ Page<ContractManagementInfo> page = new Page<>();
|
|
|
+ page.setRecords(dataList == null ? Lists.newArrayList() : dataList);
|
|
|
+ page.setTotal(dataCount == null ? 0 : dataCount);
|
|
|
+ page.setCurrent(pageView.getCurrentPage());
|
|
|
+ page.setSize(pageView.getPageSize());
|
|
|
+
|
|
|
+ return page;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 更改状态
|
|
|
+ * @param id
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public String editStatus(String id) {
|
|
|
+ // 查询合同信息
|
|
|
+ ContractManagementInfo contractManagementInfo = this.selectById(id);
|
|
|
+ if (contractManagementInfo != null) {
|
|
|
+ if (StatusEnum.CONTRACT_DO.getFlag().equals(contractManagementInfo.getStatusFlag())) {
|
|
|
+ contractManagementInfo.setStatusFlag(StatusEnum.CONTRACT_COMPLETED.getFlag());
|
|
|
+ contractManagementInfo.setStatus(StatusEnum.CONTRACT_COMPLETED.getName());
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ contractManagementInfo.setStatusFlag(StatusEnum.CONTRACT_DO.getFlag());
|
|
|
+ contractManagementInfo.setStatus(StatusEnum.CONTRACT_DO.getName());
|
|
|
+ }
|
|
|
+ this.updateById(contractManagementInfo);
|
|
|
+ return "OK";
|
|
|
+ }
|
|
|
+ return "NG";
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 删除
|
|
|
+ * @param id
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public void deleteInfo(String id){
|
|
|
+ ContractManagementInfo contractManagementInfo = this.selectById(id);
|
|
|
+ if (contractManagementInfo != null) {
|
|
|
+ this.deleteById(contractManagementInfo.getId());
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|