Commit 97cb0f3a by yinyong

新增费用大类管理成本判断

parent 7a50c5d3
......@@ -6,10 +6,7 @@ import com.blt.other.other_cost.dto.CostTypeKindDto;
import com.blt.other.other_cost.service.CostCompanyService;
import com.blt.other.other_cost.service.CostTypeKindService;
import com.blt.other.other_cost.service.CostTypeService;
import com.blt.other.other_database.model.CostCompanyDomain;
import com.blt.other.other_database.model.CostTypeDomain;
import com.blt.other.other_database.model.CostTypeKindDomain;
import com.blt.other.other_database.model.LogisticsSupplierBankDomain;
import com.blt.other.other_database.model.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -41,6 +38,8 @@ public class CostTypeController {
@Autowired
private CostTypeService costTypeService;
@Value("${costTypeKind.logisticsSubjectCode}")
private String logisticsSubjectCode; //物流科目编号
......@@ -97,6 +96,13 @@ public class CostTypeController {
String companyNo = request.getParameter("companyNo");
String typeName = request.getParameter("typeName");
String subjectCode = request.getParameter("subjectCode");
boolean ismanage = Boolean.valueOf(request.getParameter("ismanage"));
if(ismanage) {
TypeRelationDomain typeRelationDomain = costTypeService.getTyeRelation(typeName);
if(typeRelationDomain == null) {
costTypeService.insertTypeRalation(typeName);
}
}
// String costFormStr = request.getParameter("costForm");
// Integer costForm = null;
// try {
......
package com.blt.other.other_cost.dao;
import com.blt.other.other_database.model.TypeRelationDomain;
import com.blt.other.other_database.model.CostTypeDomain;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
......@@ -47,4 +48,8 @@ public interface CostTypeDao {
CostTypeDomain selectByCompanyNameAndTypeName(@Param("companyName")String companyName, @Param("typeName") String typeName);
CostTypeDomain selectByCompanyNoAndTypeNameAndCostForm(CostTypeDomain costTypeDomain);
TypeRelationDomain getTyeRelation(@Param("typeName") String typeName);
Integer insertTypeRalation(@Param("typeName") String typeName);
}
package com.blt.other.other_cost.service;
import com.blt.other.other_cost.dto.CostTypeDto;
import com.blt.other.other_database.model.TypeRelationDomain;
import com.blt.other.other_database.model.CostTypeDomain;
import java.util.List;
......@@ -29,4 +30,8 @@ public interface CostTypeService {
CostTypeDto domainToDto(CostTypeDomain costTypeDomain);
CostTypeDomain getByTypeNo(String typeNo);
TypeRelationDomain getTyeRelation(String typeName);
Integer insertTypeRalation(String typeName);
}
......@@ -3,6 +3,7 @@ package com.blt.other.other_cost.service.impl;
import com.blt.other.other_cost.dao.CostCompanyDao;
import com.blt.other.other_cost.dao.CostTypeDao;
import com.blt.other.other_cost.dto.CostTypeDto;
import com.blt.other.other_database.model.TypeRelationDomain;
import com.blt.other.other_cost.service.CostTypeService;
import com.blt.other.other_database.mapper.StatusMapper;
import com.blt.other.other_database.model.CostCompanyDomain;
......@@ -88,6 +89,16 @@ public class CostTypeServiceImpl implements CostTypeService {
return costTypeDao.selectByTypeNo(typeNo);
}
@Override
public TypeRelationDomain getTyeRelation(String typeName) {
return costTypeDao.getTyeRelation(typeName);
}
@Override
public Integer insertTypeRalation(String typeName) {
return costTypeDao.insertTypeRalation(typeName);
}
public Integer doInsert(CostTypeDomain ctd){
// 获取 companyName
CostCompanyDomain companyDomain = costCompanyDao.selectByNo(ctd.getCompanyNo());
......
......@@ -71,4 +71,17 @@
AND
type_name = #{typeName}
</select>
<select id="getTyeRelation" resultType="com.blt.other.other_database.model.TypeRelationDomain">
select
*
from
type_relation
where fee_type = #{typeName} limit 1
</select>
<insert id="insertTypeRalation">
insert into type_relation(manage_cost_type, fee_type)
value(#{typeName}, #{typeName})
</insert>
</mapper>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment