物资类型修改

This commit is contained in:
syruan 2025-01-08 15:54:47 +08:00
parent eb8fefed2e
commit e8db3d7f9c
7 changed files with 24 additions and 28 deletions

View File

@ -71,7 +71,7 @@ public class BmUnitPersonServiceImpl implements IBmUnitPersonService
/** /**
* 删除往来单位管理信息 * 删除往来单位管理信息
* *
* @param unitId 往来单位管理主键 * @param bmUnitPerson 往来单位管理主键
* @return 结果 * @return 结果
*/ */
@Override @Override

View File

@ -113,6 +113,9 @@ public class PartLeaseServiceImpl implements PartLeaseService {
*/ */
@Override @Override
public int updatePartLeaseInfo(PartLeaseInfo partLeaseInfo) { public int updatePartLeaseInfo(PartLeaseInfo partLeaseInfo) {
if (null == partLeaseInfo || null == partLeaseInfo.getTaskId()) {
throw new ServiceException("领用信息或任务ID不能为空");
}
partLeaseInfo.setCode(null); partLeaseInfo.setCode(null);
switch (partLeaseInfo.getStatus()) { switch (partLeaseInfo.getStatus()) {
case 1: case 1:

View File

@ -82,6 +82,9 @@ public class Type extends BaseEntity {
@ApiModelProperty(value = "是否扣费,0:扣费, 1:不扣费") @ApiModelProperty(value = "是否扣费,0:扣费, 1:不扣费")
private Byte isCharging = 1; private Byte isCharging = 1;
@ApiModelProperty(value = "是否试验,0:未试验, 1:已试验")
private Byte isTest = 0;
/** 检验周期 */ /** 检验周期 */
@ApiModelProperty(value = "检验周期,单位:月") @ApiModelProperty(value = "检验周期,单位:月")
private Integer testCycle = 0; private Integer testCycle = 0;

View File

@ -209,7 +209,7 @@ public class RepairAuditDetailsServiceImpl implements IRepairAuditDetailsService
Long maId = inputDetails.getMaId(); Long maId = inputDetails.getMaId();
BigDecimal repairNum = inputDetails.getRepairedNum(); BigDecimal repairNum = inputDetails.getRepairedNum();
// 创建修饰后入库任务 // 创建修饰后入库任务
if (repairNum.compareTo(b) > 0) { if (0 < repairNum.compareTo(b)) {
// 添加修试后入库任务 // 添加修试后入库任务
RepairInputDetails repairInputDetails = new RepairInputDetails(); RepairInputDetails repairInputDetails = new RepairInputDetails();
repairInputDetails.setTaskId(inputTaskId); repairInputDetails.setTaskId(inputTaskId);

View File

@ -36,6 +36,7 @@ import com.bonus.common.core.web.page.TableDataInfo;
@RestController @RestController
@RequestMapping("/slt_agreement_info") @RequestMapping("/slt_agreement_info")
public class SltAgreementInfoController extends BaseController { public class SltAgreementInfoController extends BaseController {
@Autowired @Autowired
private ISltAgreementInfoService sltAgreementInfoService; private ISltAgreementInfoService sltAgreementInfoService;

View File

@ -210,13 +210,13 @@ public class SltAgreementInfoServiceImpl implements ISltAgreementInfoService {
leaseList.addAll(oneOfList); leaseList.addAll(oneOfList);
} }
for (SltAgreementInfo bean : leaseList) { for (SltAgreementInfo bean : leaseList) {
if (bean.getLeasePrice() == null) { if (null == bean.getLeasePrice()) {
bean.setLeasePrice(BigDecimal.valueOf(0.00)); bean.setLeasePrice(BigDecimal.valueOf(0.00));
} }
if (bean.getNum() == null) { if (null == bean.getNum()) {
bean.setNum(BigDecimal.valueOf(0L)); bean.setNum(BigDecimal.valueOf(0L));
} }
if (bean.getLeaseDay() == null) { if (null == bean.getLeaseDay()) {
bean.setLeaseDay(0L); bean.setLeaseDay(0L);
} }
BigDecimal leasePrice = bean.getLeasePrice(); BigDecimal leasePrice = bean.getLeasePrice();
@ -231,10 +231,9 @@ public class SltAgreementInfoServiceImpl implements ISltAgreementInfoService {
public List<SltAgreementInfo> getRepairList(List<SltAgreementInfo> list) { public List<SltAgreementInfo> getRepairList(List<SltAgreementInfo> list) {
List<SltAgreementInfo> repairList = new ArrayList<>(); List<SltAgreementInfo> repairList = new ArrayList<>();
Integer taskType = TmTaskTypeEnum.TM_TASK_REPAIR.getTaskTypeId(); Integer taskType = TmTaskTypeEnum.TM_TASK_REPAIR.getTaskTypeId();
//String taskType = TaskTypeEnum.MAINTENANCE_TASK.getCode();
for (SltAgreementInfo bean : list) { for (SltAgreementInfo bean : list) {
List<TmTask> taskList = taskMapper.getTaskList(bean, taskType); List<TmTask> taskList = taskMapper.getTaskList(bean, taskType);
if (taskList != null && taskList.size() > 0) { if (null != taskList && !taskList.isEmpty()) {
List<SltAgreementInfo> repairDetailsList = sltAgreementInfoMapper.getRepairDetailsList(taskList); List<SltAgreementInfo> repairDetailsList = sltAgreementInfoMapper.getRepairDetailsList(taskList);
repairList.addAll(repairDetailsList); repairList.addAll(repairDetailsList);
} }
@ -245,33 +244,25 @@ public class SltAgreementInfoServiceImpl implements ISltAgreementInfoService {
public List<SltAgreementInfo> getScrapList(List<SltAgreementInfo> list) { public List<SltAgreementInfo> getScrapList(List<SltAgreementInfo> list) {
List<SltAgreementInfo> scrapList = new ArrayList<>(); List<SltAgreementInfo> scrapList = new ArrayList<>();
Integer taskType = TmTaskTypeEnum.TM_TASK_SCRAP.getTaskTypeId(); Integer taskType = TmTaskTypeEnum.TM_TASK_SCRAP.getTaskTypeId();
//String taskType = TaskTypeEnum.SCRAP_TASK.getCode();
for (SltAgreementInfo bean : list) { for (SltAgreementInfo bean : list) {
List<TmTask> taskList = taskMapper.getTaskList(bean, taskType); List<TmTask> taskList = taskMapper.getTaskList(bean, taskType);
if (taskList != null && taskList.size() > 0) { if (null != taskList && !taskList.isEmpty()) {
List<SltAgreementInfo> scrapDetailsList = sltAgreementInfoMapper.getScrapDetailsList(taskList); List<SltAgreementInfo> scrapDetailsList = sltAgreementInfoMapper.getScrapDetailsList(taskList);
scrapList.addAll(scrapDetailsList); scrapList.addAll(scrapDetailsList);
} }
} }
if (scrapList != null && scrapList.size() > 0) { if (!scrapList.isEmpty()) {
for (SltAgreementInfo bean : scrapList) { for (SltAgreementInfo bean : scrapList) {
if (null == bean.getBuyPrice()) {
if (bean.getBuyPrice() == null) {
bean.setBuyPrice(BigDecimal.valueOf(0.00)); bean.setBuyPrice(BigDecimal.valueOf(0.00));
} }
if (bean.getNum() == null) { if (null == bean.getNum()) {
bean.setNum(BigDecimal.valueOf(0L)); bean.setNum(BigDecimal.valueOf(0L));
} }
BigDecimal buyPrice = bean.getBuyPrice(); BigDecimal buyPrice = bean.getBuyPrice();
BigDecimal num = bean.getNum(); BigDecimal num = bean.getNum();
BigDecimal costs = buyPrice.multiply(num); BigDecimal costs = buyPrice.multiply(num);
//计算总金额 //计算总金额
/*BigDecimal costs = BigDecimal.ZERO;
if (bean.getBuyPrice() != null && bean.getBuyPrice() != null){
BigDecimal buyPrice = new BigDecimal(bean.getBuyPrice());
BigDecimal num = new BigDecimal(bean.getNum());
costs = buyPrice.multiply(num);
}*/
bean.setCosts(costs); bean.setCosts(costs);
} }
} }
@ -285,10 +276,10 @@ public class SltAgreementInfoServiceImpl implements ISltAgreementInfoService {
loseList.addAll(oneOfList); loseList.addAll(oneOfList);
} }
for (SltAgreementInfo bean : loseList) { for (SltAgreementInfo bean : loseList) {
if (bean.getBuyPrice() == null) { if (null == bean.getBuyPrice()) {
bean.setBuyPrice(BigDecimal.valueOf(0.00)); bean.setBuyPrice(BigDecimal.valueOf(0.00));
} }
if (bean.getNum() == null) { if (null == bean.getNum()) {
bean.setNum(BigDecimal.valueOf(0L)); bean.setNum(BigDecimal.valueOf(0L));
} }
BigDecimal buyPrice = bean.getBuyPrice(); BigDecimal buyPrice = bean.getBuyPrice();
@ -296,12 +287,6 @@ public class SltAgreementInfoServiceImpl implements ISltAgreementInfoService {
// 原价 x 数量 // 原价 x 数量
BigDecimal costs = buyPrice.multiply(num); BigDecimal costs = buyPrice.multiply(num);
//计算租赁费用 //计算租赁费用
/*BigDecimal costs = BigDecimal.ZERO;
if (bean.getBuyPrice() != null && bean.getNum() != null){
BigDecimal buyPrice = new BigDecimal(bean.getBuyPrice());
BigDecimal num = new BigDecimal(bean.getNum());
costs = buyPrice.multiply(num);
}*/
bean.setCosts(costs); bean.setCosts(costs);
} }
return loseList; return loseList;

View File

@ -42,6 +42,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="remark" column="remark" /> <result property="remark" column="remark" />
<result property="facModel" column="fac_model" /> <result property="facModel" column="fac_model" />
<result property="intelligentCode" column="intelligent_code" /> <result property="intelligentCode" column="intelligent_code" />
<result property="isTest" column="is_test" />
</resultMap> </resultMap>
<resultMap type="com.bonus.material.ma.domain.vo.MaTypeVo" id="MaTypeVoResult"> <resultMap type="com.bonus.material.ma.domain.vo.MaTypeVo" id="MaTypeVoResult">
@ -163,7 +164,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
t.model_code,t.unit_id,t.unit_name,t.unit_value,t.sort_num,t.manage_type,t.lease_price,t.eff_time, t.model_code,t.unit_id,t.unit_name,t.unit_value,t.sort_num,t.manage_type,t.lease_price,t.eff_time,
t.rent_price,t.buy_price,t.pay_ratio,t.pay_price,t.tax_ratio,t.level,t.rated_load,t.test_load, t.rent_price,t.buy_price,t.pay_ratio,t.pay_price,t.tax_ratio,t.level,t.rated_load,t.test_load,
t.holding_time,t.warn_num,t.create_by,t.create_time,t.update_by,t.update_time,t.is_plan, t.holding_time,t.warn_num,t.create_by,t.create_time,t.update_by,t.update_time,t.is_plan,
t.is_ancuo,t.remark,t.fac_model,t.intelligent_code, t.is_ancuo,t.remark,t.fac_model,t.intelligent_code,t.is_test,
GROUP_CONCAT(distinct su.user_name) as keeper_nick_name, GROUP_CONCAT(distinct su.user_name) as keeper_nick_name,
GROUP_CONCAT(distinct su.user_id) as keeperId, GROUP_CONCAT(distinct su.user_id) as keeperId,
GROUP_CONCAT(distinct su2.user_name) as repair_nick_name, GROUP_CONCAT(distinct su2.user_name) as repair_nick_name,
@ -246,6 +247,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="remark != null">remark,</if> <if test="remark != null">remark,</if>
<if test="facModel != null">fac_model,</if> <if test="facModel != null">fac_model,</if>
<if test="intelligentCode != null">intelligent_code,</if> <if test="intelligentCode != null">intelligent_code,</if>
<if test="isTest != null">is_test,</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="typeName != null and typeName != ''">#{typeName},</if> <if test="typeName != null and typeName != ''">#{typeName},</if>
@ -279,6 +281,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="remark != null">#{remark},</if> <if test="remark != null">#{remark},</if>
<if test="facModel != null">#{facModel},</if> <if test="facModel != null">#{facModel},</if>
<if test="intelligentCode != null">#{intelligentCode},</if> <if test="intelligentCode != null">#{intelligentCode},</if>
<if test="isTest != null">#{isTest},</if>
</trim> </trim>
</insert> </insert>
@ -315,6 +318,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="remark != null">remark = #{remark},</if> <if test="remark != null">remark = #{remark},</if>
<if test="facModel != null">fac_model = #{facModel},</if> <if test="facModel != null">fac_model = #{facModel},</if>
<if test="intelligentCode != null">intelligent_code = #{intelligentCode},</if> <if test="intelligentCode != null">intelligent_code = #{intelligentCode},</if>
<if test="isTest != null">is_test = #{isTest},</if>
</trim> </trim>
where type_id = #{typeId} where type_id = #{typeId}
</update> </update>