This commit is contained in:
parent
b8aeeeff3b
commit
0de34998f7
|
|
@ -166,4 +166,7 @@ public class LeaseOutDetails extends BaseEntity {
|
|||
@ApiModelProperty(value = "来源")
|
||||
private Integer source;
|
||||
|
||||
@ApiModelProperty(value = "领料方式 0材料领料 1工器具领料 2数据同步")
|
||||
private String leaseStyle;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -206,4 +206,10 @@ public class BackApplyInfo implements Serializable {
|
|||
|
||||
@ApiModelProperty(value = "材料员确认备注")
|
||||
private String confirmRemark;
|
||||
|
||||
@ApiModelProperty(value="工程id")
|
||||
private Long projectId;
|
||||
|
||||
@ApiModelProperty(value = "退料方式(1 直退,2 数据同步)")
|
||||
private String backStyle;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ import com.bonus.material.back.domain.MaCodeDto;
|
|||
import com.bonus.material.back.domain.vo.BackApplyInfoVo;
|
||||
import com.bonus.material.back.domain.vo.BackApplyVo;
|
||||
import com.bonus.material.back.domain.vo.MaCodeVo;
|
||||
import com.bonus.material.clz.domain.back.MaterialBackApplyDetails;
|
||||
import com.bonus.material.settlement.domain.SltAgreementInfo;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
|
|
@ -428,6 +429,34 @@ public interface BackApplyInfoMapper {
|
|||
*/
|
||||
List<BackApplyDetails> selectBackApplyDetailsList(BackApplyDetails backApplyDetails);
|
||||
|
||||
/**
|
||||
* 根据单位和工程id查询项目部关联协议id
|
||||
* @param backApplyInfo
|
||||
* @return
|
||||
*/
|
||||
BackApplyInfo selectInfo(BackApplyInfo backApplyInfo);
|
||||
|
||||
/**
|
||||
* 根据任务id查询协议信息
|
||||
* @param info
|
||||
* @return
|
||||
*/
|
||||
SltAgreementInfo getStlInfoByTaskId(SltAgreementInfo info);
|
||||
|
||||
/**
|
||||
* 查询拆分退料任务单
|
||||
* @param backApplyDetails
|
||||
* @return
|
||||
*/
|
||||
List<BackApplyInfo> selectClzList(MaterialBackApplyDetails backApplyDetails);
|
||||
|
||||
/**
|
||||
* 查询项目退料任务单
|
||||
* @param details
|
||||
* @return
|
||||
*/
|
||||
List<BackApplyInfo> selectXmList(BackApplyDetails details);
|
||||
|
||||
List<MaCodeVo> getMachineByOne(BackApplyInfo dto);
|
||||
|
||||
List<MaCodeVo> getMachineByTwo(BackApplyInfo dto);
|
||||
|
|
@ -439,4 +468,11 @@ public interface BackApplyInfoMapper {
|
|||
List<MaCodeVo> getMachineByTwoMaCode(BackApplyInfo dto);
|
||||
|
||||
List<MaCodeVo> getMachineByThreeMaCode(BackApplyInfo dto);
|
||||
|
||||
/**
|
||||
* 查询是否存在班组数据
|
||||
* @param bean
|
||||
* @return
|
||||
*/
|
||||
List<SltAgreementInfo> getTbList(BackApplyInfo bean);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -977,12 +977,12 @@ public class BackApplyInfoServiceImpl implements IBackApplyInfoService {
|
|||
} else {
|
||||
return AjaxResult.error("退料物资为空,无法进行提交");
|
||||
}
|
||||
// 判断是否为班组退料,将退料同步材料站
|
||||
// 判断是否为班组退料,将退料同步材料站以及项目部
|
||||
boolean isClz = false;
|
||||
/*BmUnit unit = taskMapper.selectBmUnitInfo(backApplyInfo);
|
||||
BmUnit unit = taskMapper.selectBmUnitInfo(backApplyInfo);
|
||||
if (unit != null && unit.getTypeId() == 1731L) {
|
||||
isClz = true;
|
||||
}*/
|
||||
}
|
||||
// 设置更新信息,
|
||||
backApplyInfo.setUpdateBy(SecurityUtils.getLoginUser().getSysUser().getNickName());
|
||||
backApplyInfo.setUpdateTime(DateUtils.getNowDate());
|
||||
|
|
@ -1006,6 +1006,7 @@ public class BackApplyInfoServiceImpl implements IBackApplyInfoService {
|
|||
bmAgreementInfo.setUnitId(backApplyInfo.getUnitId());
|
||||
bmAgreementInfo.setProjectId(backApplyInfo.getProId());
|
||||
BmAgreementInfo info = bmAgreementInfoMapper.queryByTeamIdAndProjectIdCl(bmAgreementInfo);
|
||||
BackApplyInfo backApplyInfo4 = new BackApplyInfo();
|
||||
if (isClz) {
|
||||
int thisMonthMaxOrder = taskMapper.getMonthMaxOrderByDate(DateUtils.getCurrentYear(), DateUtils.getCurrentMonth(), TmTaskTypeEnum.TM_TASK_MATERIAL_BACK.getTaskTypeId());
|
||||
String code = genderClzTaskCode(thisMonthMaxOrder);
|
||||
|
|
@ -1049,6 +1050,45 @@ public class BackApplyInfoServiceImpl implements IBackApplyInfoService {
|
|||
}
|
||||
}
|
||||
}
|
||||
// 材料站对分公司建立退料任务
|
||||
int backMonthMaxOrder = taskMapper.getMonthMaxOrderByDate(DateUtils.getCurrentYear(), DateUtils.getCurrentMonth(), TmTaskTypeEnum.TM_TASK_BACK.getTaskTypeId());
|
||||
String backCode = genderTaskCode(backMonthMaxOrder);
|
||||
TmTask newTask = new TmTask(null, TmTaskTypeEnum.TM_TASK_BACK.getTaskTypeId(),
|
||||
BackTaskStatusEnum.BACK_TASK_IN_FINISHED.getStatus(),
|
||||
null,backMonthMaxOrder + 1, backCode);
|
||||
newTask.setCreateTime(DateUtils.getNowDate());
|
||||
newTask.setCreateBy(SecurityUtils.getLoginUser().getSysUser().getNickName());
|
||||
backApplyInfo4.setCode(backCode);
|
||||
backApplyInfo4.setCreateBy(SecurityUtils.getLoginUser().getSysUser().getNickName());
|
||||
backApplyInfo4.setCreateTime(DateUtils.getNowDate());
|
||||
// 保存退料信息到 tm_task 表中
|
||||
result += taskMapper.insertTmTask(newTask);
|
||||
if (result > 0) {
|
||||
// 根据单位和工程id查询项目部关联协议id
|
||||
BackApplyInfo backApplyInfo3 = backApplyInfoMapper.selectInfo(backApplyInfo);
|
||||
if (backApplyInfo3 != null) {
|
||||
TmTaskAgreement tmTaskAgreement = new TmTaskAgreement(newTask.getTaskId(), backApplyInfo3.getAgreementId());
|
||||
tmTaskAgreement.setCreateTime(DateUtils.getNowDate());
|
||||
tmTaskAgreement.setCreateBy(SecurityUtils.getLoginUser().getSysUser().getNickName());
|
||||
taskAgreementMapper.insertTmTaskAgreement(tmTaskAgreement);
|
||||
}
|
||||
backApplyInfo4.setTaskId(newTask.getTaskId());
|
||||
BackApplyInfo backApplyInfo2 = backApplyInfoMapper.selectBackApplyInfoById(backApplyInfo.getId());
|
||||
if (backApplyInfo2 != null) {
|
||||
backApplyInfo4.setBackPerson(StringUtils.isNotBlank(backApplyInfo2.getBackPerson()) ? backApplyInfo2.getBackPerson() : "");
|
||||
backApplyInfo4.setPhone(StringUtils.isNotBlank(backApplyInfo2.getPhone()) ? backApplyInfo2.getPhone() : "");
|
||||
backApplyInfo4.setBackStyle("2");
|
||||
}
|
||||
result += backApplyInfoMapper.insertBackApplyInfo(backApplyInfo4);
|
||||
}
|
||||
// 保存退料详情
|
||||
if (CollectionUtils.isNotEmpty(applyDetails)) {
|
||||
for (BackApplyDetails applyDetail : applyDetails) {
|
||||
// 保存退料详情
|
||||
applyDetail.setAuditNum(applyDetail.getPreNum());
|
||||
result += backApplyInfoMapper.insertBackApplyDetails(applyDetail);
|
||||
}
|
||||
}
|
||||
}
|
||||
for (String typeId : typeIdList) {
|
||||
// 查询待维修的机具设备
|
||||
|
|
@ -1060,11 +1100,13 @@ public class BackApplyInfoServiceImpl implements IBackApplyInfoService {
|
|||
// 更新结算表
|
||||
List<BackApplyInfo> allList = backApplyInfoMapper.selectBackDetails(backApplyInfo);
|
||||
if (CollectionUtils.isNotEmpty(allList)) {
|
||||
int res = updateSlt4Bean(backApplyInfo, allList);
|
||||
int res = updateSlt4Bean(isClz,backApplyInfo, allList);
|
||||
// 检查机具是否领料
|
||||
if (res == 0) {
|
||||
throw new RuntimeException("该机具未被领料使用");
|
||||
}
|
||||
List<BackApplyInfo> clzList = new ArrayList<>();
|
||||
List<BackApplyInfo> xmList = new ArrayList<>();
|
||||
if (isClz) {
|
||||
for (BackApplyInfo applyInfo : allList) {
|
||||
applyInfo.setAgreementId(info.getAgreementId());
|
||||
|
|
@ -1078,11 +1120,29 @@ public class BackApplyInfoServiceImpl implements IBackApplyInfoService {
|
|||
details.setMaId(applyInfo.getMaId() != null ? applyInfo.getMaId() : null);
|
||||
details.setIsFinished(1);
|
||||
result += materialBackInfoMapper.insertCheckDetails(details);
|
||||
// 查询材料站同步数据
|
||||
clzList = backApplyInfoMapper.selectClzList(details);
|
||||
BackApplyDetails backApplyDetails = new BackApplyDetails();
|
||||
backApplyDetails.setParentId(backApplyInfo4.getId());
|
||||
backApplyDetails.setTypeId(Long.parseLong(typeId));
|
||||
backApplyDetails.setCreateBy(SecurityUtils.getLoginUser().getSysUser().getNickName());
|
||||
backApplyDetails.setCreateTime(DateUtils.getNowDate());
|
||||
backApplyDetails.setPreNum(applyInfo.getBackNum());
|
||||
backApplyDetails.setMaId(applyInfo.getMaId() != null ? applyInfo.getMaId() : null);
|
||||
backApplyDetails.setStatus("0");
|
||||
backApplyDetails.setIsFinished(1);
|
||||
result += backApplyInfoMapper.insertCheckDetails(backApplyDetails);
|
||||
// 查询项目部同步数据
|
||||
xmList = backApplyInfoMapper.selectXmList(backApplyDetails);
|
||||
}
|
||||
res = updateSlt4BeanClz(materialBackApplyInfo, allList);
|
||||
res = updateSlt4BeanClz(materialBackApplyInfo, clzList);
|
||||
if (res == 0) {
|
||||
throw new RuntimeException("同步材料站结算出错");
|
||||
}
|
||||
res = updateSlt4BeanXm(backApplyInfo4, xmList);
|
||||
if (res == 0) {
|
||||
throw new RuntimeException("同步项目部结算出错");
|
||||
}
|
||||
}
|
||||
}
|
||||
// 完成退料部分,更新 back_check_details
|
||||
|
|
@ -1098,6 +1158,39 @@ public class BackApplyInfoServiceImpl implements IBackApplyInfoService {
|
|||
return AjaxResult.error(HttpCodeEnum.FAIL.getCode(), HttpCodeEnum.FAIL.getMsg());
|
||||
}
|
||||
|
||||
/**
|
||||
* 结算处理
|
||||
* @param record
|
||||
* @param allList
|
||||
* @return
|
||||
*/
|
||||
private int updateSlt4BeanXm(BackApplyInfo record, List<BackApplyInfo> allList) {
|
||||
for (BackApplyInfo bean : allList) {
|
||||
List<SltAgreementInfo> infoList = backApplyInfoMapper.getStlInfo(bean);
|
||||
if (infoList.size() > 0) {
|
||||
BigDecimal backNum = bean.getBackNum();
|
||||
for (SltAgreementInfo info : infoList) {
|
||||
BigDecimal num = info.getBackNum();
|
||||
if (backNum.compareTo(num) == 0) {
|
||||
backApplyInfoMapper.updateStlInfo(info, record);
|
||||
break;
|
||||
} else if (backNum.compareTo(num) > 0) {
|
||||
backNum = backNum.subtract(num);
|
||||
backApplyInfoMapper.updateStlInfo(info, record);
|
||||
} else {
|
||||
BigDecimal many = num.subtract(backNum);
|
||||
backApplyInfoMapper.updateStlInfoTwo(info, record, backNum);
|
||||
backApplyInfoMapper.insStlInfoTwo(info, many);
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* 生成材料站退料任务单号
|
||||
* @param thisMonthMaxOrder
|
||||
|
|
@ -2103,12 +2196,18 @@ public class BackApplyInfoServiceImpl implements IBackApplyInfoService {
|
|||
* @param allList
|
||||
* @return
|
||||
*/
|
||||
private int updateSlt4Bean(BackApplyInfo record, List<BackApplyInfo> allList) {
|
||||
private int updateSlt4Bean(Boolean isClz ,BackApplyInfo record, List<BackApplyInfo> allList) {
|
||||
for (BackApplyInfo bean : allList) {
|
||||
List<SltAgreementInfo> infoList = backApplyInfoMapper.getStlInfo(bean);
|
||||
if (infoList.size() > 0) {
|
||||
// 查询是否存在班组数据
|
||||
List<SltAgreementInfo> tbList = backApplyInfoMapper.getTbList(bean);
|
||||
if (CollectionUtils.isEmpty(infoList)) {
|
||||
return 0;
|
||||
}
|
||||
BigDecimal backNum = bean.getBackNum();
|
||||
// 遍历每个typeId
|
||||
for (SltAgreementInfo info : infoList) {
|
||||
// 获取前端要退数量
|
||||
BigDecimal num = info.getBackNum();
|
||||
if (backNum.compareTo(num) == 0) {
|
||||
backApplyInfoMapper.updateStlInfo(info, record);
|
||||
|
|
@ -2123,8 +2222,27 @@ public class BackApplyInfoServiceImpl implements IBackApplyInfoService {
|
|||
break;
|
||||
}
|
||||
}
|
||||
// 非班组退料才同步班组分公司数据
|
||||
if (!isClz) {
|
||||
BigDecimal tbBackNum = bean.getBackNum();
|
||||
if (CollectionUtils.isNotEmpty(tbList)) {
|
||||
for (SltAgreementInfo info : tbList) {
|
||||
// 获取前端要退数量
|
||||
BigDecimal num = info.getBackNum();
|
||||
if (tbBackNum.compareTo(num) == 0) {
|
||||
backApplyInfoMapper.updateStlInfo(info, record);
|
||||
break;
|
||||
} else if (tbBackNum.compareTo(num) > 0) {
|
||||
tbBackNum = tbBackNum.subtract(num);
|
||||
backApplyInfoMapper.updateStlInfo(info, record);
|
||||
} else {
|
||||
return 0;
|
||||
BigDecimal many = num.subtract(tbBackNum);
|
||||
backApplyInfoMapper.updateStlInfoTwo(info, record, tbBackNum);
|
||||
backApplyInfoMapper.insStlInfoTwo(info, many);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
|
|
|
|||
|
|
@ -1557,17 +1557,6 @@ public class MaterialLeaseInfoServiceImpl implements MaterialLeaseInfoService {
|
|||
record.setOutType(leaseMaCodeDto.getOutType());
|
||||
record.setTypeId(Long.parseLong(leaseMaCodeDto.getTypeId()));
|
||||
int res = materialLeaseInfoMapper.insertLeaseOutDetails(record);
|
||||
/*// 更新 (ma_machine 设备表)的状态
|
||||
if (res > 0) {
|
||||
machineMapper.updateMaMachineStatus(record, MaMachineStatusEnum.IN_USE.getStatus());
|
||||
}
|
||||
if (res > 0) {
|
||||
// 普通机具减少 (ma_type 设备规格表)的库存数量
|
||||
res = typeMapper.updateMaTypeStockNum(record);
|
||||
if (res == 0) {
|
||||
return AjaxResult.error("更新ma_type表数据失败");
|
||||
}
|
||||
}*/
|
||||
if (res > 0) {
|
||||
res = insSltInfo(taskId, record);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -452,6 +452,7 @@ public class LeaseOutDetailsServiceImpl implements ILeaseOutDetailsService {
|
|||
String agreementId = tmTaskAgreementMapper.getAgreementId(taskId.toString());
|
||||
Type maType = typeMapper.getMaType(record.getTypeId());
|
||||
maType.setFinalPrice(maType.getLeasePrice());
|
||||
record.setLeaseStyle("2");
|
||||
res = materialLeaseInfoMapper.insSltInfo(record, agreementId, maType);
|
||||
}
|
||||
return res;
|
||||
|
|
|
|||
|
|
@ -237,4 +237,9 @@ public class SltAgreementInfo extends BaseEntity {
|
|||
|
||||
//结算费用
|
||||
private BigDecimal totalCostAll;
|
||||
|
||||
@ApiModelProperty(value = "领料方式 0材料领料 1工器具领料 2数据同步")
|
||||
private String leaseStyle;
|
||||
|
||||
private String source;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -76,7 +76,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
JOIN ma_type_repair mtr ON mtr.type_id = bad.type_id AND mtr.user_id = #{userId}
|
||||
</if>
|
||||
WHERE
|
||||
1=1
|
||||
bai.back_style = '1'
|
||||
<if test="unitId != null">
|
||||
and bu.unit_id = #{unitId}
|
||||
</if>
|
||||
|
|
@ -135,7 +135,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
AND mt2.del_flag = '0'
|
||||
LEFT JOIN bm_agreement_info ba ON sai.agreement_id = ba.agreement_id
|
||||
WHERE
|
||||
mm.ma_status = '2'
|
||||
sai.`status` = '0'
|
||||
AND mm.ma_status = '2'
|
||||
AND ba.unit_id = #{unitId}
|
||||
AND ba.project_id = #{proId}
|
||||
<if test="typeId != null">
|
||||
|
|
@ -146,7 +147,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
mm.ma_code like concat('%', #{keyWord}, '%')
|
||||
)
|
||||
</if>
|
||||
GROUP BY mm.ma_code
|
||||
GROUP BY mm.ma_id
|
||||
</select>
|
||||
|
||||
<select id="selectBackApplyInfoById" resultType="com.bonus.material.back.domain.BackApplyInfo">
|
||||
|
|
@ -503,6 +504,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="backTime != null">back_time,</if>
|
||||
<if test="status != null">status,</if>
|
||||
<if test="directId != null">direct_id,</if>
|
||||
<if test="backStyle != null and backStyle != ''">back_style,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="code != null">#{code},</if>
|
||||
|
|
@ -521,6 +523,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="backTime != null">#{backTime},</if>
|
||||
<if test="status != null">#{status},</if>
|
||||
<if test="directId != null">#{directId},</if>
|
||||
<if test="backStyle != null and backStyle != ''">#{backStyle},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
|
|
@ -1350,4 +1353,111 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
AND ba.unit_id = #{unitId}
|
||||
AND ba.project_id = #{proId}
|
||||
</select>
|
||||
|
||||
<select id="selectInfo" resultType="com.bonus.material.back.domain.BackApplyInfo">
|
||||
SELECT
|
||||
bm.agreement_id as agreementId,
|
||||
bm.unit_id as unitId,
|
||||
bm.project_id as proId
|
||||
FROM
|
||||
bm_agreement_info bmi
|
||||
LEFT JOIN bm_agreement_info bm ON bmi.project_id = bm.project_id
|
||||
AND bmi.project_unit_id = bm.unit_id
|
||||
WHERE
|
||||
bmi.unit_id = #{unitId}
|
||||
AND bmi.project_id = #{proId}
|
||||
</select>
|
||||
|
||||
<select id="getStlInfoByTaskId" resultType="com.bonus.material.settlement.domain.SltAgreementInfo">
|
||||
SELECT
|
||||
id AS id,
|
||||
agreement_id AS agreementId,
|
||||
type_id AS typeId,
|
||||
lease_id AS leaseId
|
||||
FROM
|
||||
slt_agreement_info
|
||||
WHERE
|
||||
lease_id = #{leaseId}
|
||||
AND type_id = #{typeId}
|
||||
AND STATUS = 0
|
||||
AND agreement_id != #{agreementId}
|
||||
</select>
|
||||
|
||||
<select id="selectClzList" resultType="com.bonus.material.back.domain.BackApplyInfo">
|
||||
SELECT
|
||||
bai.id AS id,
|
||||
tta.agreement_id AS agreementId,
|
||||
bai.task_id AS taskId,
|
||||
bcd.type_id AS typeId,
|
||||
SUM(bcd.back_num) AS backNum,
|
||||
bcd.parent_id AS parentId,
|
||||
bcd.create_by AS createBy,
|
||||
bcd.ma_id AS maId,
|
||||
mm.ma_status AS maStatus,
|
||||
mm.ma_code AS maCode
|
||||
FROM
|
||||
clz_back_check_details bcd
|
||||
LEFT JOIN clz_back_apply_info bai ON bai.id = bcd.parent_id
|
||||
LEFT JOIN tm_task_agreement tta ON tta.task_id = bai.task_id
|
||||
LEFT JOIN ma_machine mm ON bcd.ma_id = mm.ma_id
|
||||
WHERE
|
||||
bcd.parent_id = #{parentId}
|
||||
<if test="typeId != '' and typeId != null">
|
||||
and bcd.type_id = #{typeId}
|
||||
</if>
|
||||
GROUP By bcd.type_id,bcd.ma_id
|
||||
</select>
|
||||
|
||||
<select id="selectXmList" resultType="com.bonus.material.back.domain.BackApplyInfo">
|
||||
SELECT
|
||||
bai.id AS id,
|
||||
tta.agreement_id AS agreementId,
|
||||
bai.task_id AS taskId,
|
||||
bcd.type_id AS typeId,
|
||||
SUM(bcd.back_num) AS backNum,
|
||||
bcd.parent_id AS parentId,
|
||||
bcd.create_by AS createBy,
|
||||
bcd.ma_id AS maId,
|
||||
mm.ma_status AS maStatus,
|
||||
mm.ma_code AS maCode
|
||||
FROM
|
||||
back_check_details bcd
|
||||
LEFT JOIN back_apply_info bai ON bai.id = bcd.parent_id
|
||||
LEFT JOIN tm_task_agreement tta ON tta.task_id = bai.task_id
|
||||
LEFT JOIN ma_machine mm ON bcd.ma_id = mm.ma_id
|
||||
WHERE
|
||||
bcd.parent_id = #{parentId}
|
||||
<if test="typeId != '' and typeId != null">
|
||||
and bcd.type_id = #{typeId}
|
||||
</if>
|
||||
GROUP By bcd.type_id,bcd.ma_id
|
||||
</select>
|
||||
|
||||
<select id="getTbList" resultType="com.bonus.material.settlement.domain.SltAgreementInfo">
|
||||
SELECT
|
||||
id AS id,
|
||||
agreement_id AS agreementId,
|
||||
type_id AS typeId,
|
||||
ma_id AS maId,
|
||||
num AS backNum,
|
||||
start_time AS startTime,
|
||||
end_time AS endTime,
|
||||
status AS status,
|
||||
lease_id AS leaseId,
|
||||
lease_type AS leaseType,
|
||||
back_id AS backId,
|
||||
lease_price AS leasePrice,
|
||||
buy_price AS buyPrice,
|
||||
company_id AS companyId
|
||||
FROM
|
||||
slt_agreement_info
|
||||
WHERE
|
||||
source = '1'
|
||||
AND type_id = #{typeId}
|
||||
AND status = 0
|
||||
<if test="maId != null">
|
||||
AND ma_id = #{maId}
|
||||
</if>
|
||||
order by start_time asc
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
|
|||
|
|
@ -543,7 +543,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
back_id AS backId,
|
||||
lease_price AS leasePrice,
|
||||
buy_price AS buyPrice,
|
||||
company_id AS companyId
|
||||
company_id AS companyId,
|
||||
lease_style AS leaseStyle
|
||||
FROM
|
||||
clz_slt_agreement_info
|
||||
WHERE
|
||||
|
|
|
|||
|
|
@ -280,8 +280,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</insert>
|
||||
|
||||
<insert id="insSltInfo">
|
||||
insert into clz_slt_agreement_info (agreement_id,type_id,ma_id,num,start_time,status,lease_id,lease_price,buy_price,is_slt,company_id,lease_type,create_time,publish_task)
|
||||
values (#{agreementId},#{record.typeId},#{record.maId},#{record.outNum},now(),0,#{record.parentId},#{ma.finalPrice},#{ma.buyPrice},'0',#{record.companyId},#{record.leaseType},now(),#{record.publishTask});
|
||||
insert into clz_slt_agreement_info (agreement_id,type_id,ma_id,num,start_time,status,lease_id,lease_price,buy_price,is_slt,company_id,lease_type,create_time,publish_task, lease_style)
|
||||
values (#{agreementId},#{record.typeId},#{record.maId},#{record.outNum},now(),0,#{record.parentId},#{ma.finalPrice},#{ma.buyPrice},'0',#{record.companyId},#{record.leaseType},now(),#{record.publishTask}, #{record.leaseStyle});
|
||||
</insert>
|
||||
|
||||
<insert id="insertLeaseApplyDetails">
|
||||
|
|
@ -929,8 +929,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="publishTask != null and publishTask != ''">
|
||||
AND publish_task = #{publishTask}
|
||||
</if>
|
||||
AND
|
||||
DATE(start_time) = CURDATE();
|
||||
</select>
|
||||
|
||||
<select id="getUseTypeTree" resultType="com.bonus.common.biz.domain.TypeTreeNode">
|
||||
|
|
|
|||
|
|
@ -517,9 +517,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
bu.unit_name AS name
|
||||
FROM
|
||||
bm_unit bu
|
||||
LEFT JOIN pro_authorize_info pa ON bu.unit_id = pa.team_id
|
||||
WHERE
|
||||
bu.del_flag = '0' and pa.del_flag = '0'
|
||||
bu.del_flag = '0'
|
||||
and bu.type_id = 1731
|
||||
</select>
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue