退料完成问题提交
This commit is contained in:
parent
330f40f25f
commit
fd9710cc08
|
|
@ -220,6 +220,7 @@ public class BackApplyController extends BaseController {
|
||||||
}
|
}
|
||||||
for (BackApplyInfo backApplyInfo : record.getBackApplyDetails()) {
|
for (BackApplyInfo backApplyInfo : record.getBackApplyDetails()) {
|
||||||
backApplyInfo.setParentId(record.getParentId());
|
backApplyInfo.setParentId(record.getParentId());
|
||||||
|
backApplyService.updateBackInfo(record.getParentId(),record.getCompanyId());
|
||||||
boolean re = backApplyService.upload(backApplyInfo) > 0;
|
boolean re = backApplyService.upload(backApplyInfo) > 0;
|
||||||
if (!re) {
|
if (!re) {
|
||||||
return AjaxResult.error("退料任务明细插入失败");
|
return AjaxResult.error("退料任务明细插入失败");
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,7 @@ import com.bonus.sgzb.app.domain.BmAgreementInfo;
|
||||||
import com.bonus.sgzb.app.domain.MachinePart;
|
import com.bonus.sgzb.app.domain.MachinePart;
|
||||||
import com.bonus.sgzb.app.domain.TmTask;
|
import com.bonus.sgzb.app.domain.TmTask;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
|
@ -41,11 +42,13 @@ public interface BackApplyAppMapper {
|
||||||
int del(BackApplyInfo record);
|
int del(BackApplyInfo record);
|
||||||
|
|
||||||
List<BackApplyInfo> examineList(BackApplyInfo record);
|
List<BackApplyInfo> examineList(BackApplyInfo record);
|
||||||
|
|
||||||
List<BackApplyInfo> examineListByUser(BackApplyInfo record);
|
List<BackApplyInfo> examineListByUser(BackApplyInfo record);
|
||||||
|
|
||||||
List<BackApplyInfo> examineView(BackApplyInfo record);
|
List<BackApplyInfo> examineView(BackApplyInfo record);
|
||||||
|
|
||||||
int audit(BackApplyInfo record);
|
int audit(BackApplyInfo record);
|
||||||
|
|
||||||
int updateBackApply(BackApplyInfo record);
|
int updateBackApply(BackApplyInfo record);
|
||||||
|
|
||||||
List<BackApplyInfo> selectBackApplyInfo(BackApplyInfo record);
|
List<BackApplyInfo> selectBackApplyInfo(BackApplyInfo record);
|
||||||
|
|
@ -57,4 +60,6 @@ public interface BackApplyAppMapper {
|
||||||
List<TmTask> getMaTypeDetails(BackApplyInfo backApplyInfo);
|
List<TmTask> getMaTypeDetails(BackApplyInfo backApplyInfo);
|
||||||
|
|
||||||
MachinePart getMachineParts(TmTask typeId);
|
MachinePart getMachineParts(TmTask typeId);
|
||||||
|
|
||||||
|
void updateBackInfo(@Param("parentId") Integer parentId,@Param("companyId") String companyId);
|
||||||
}
|
}
|
||||||
|
|
@ -112,4 +112,6 @@ public interface BackApplyService {
|
||||||
* @return int
|
* @return int
|
||||||
*/
|
*/
|
||||||
int refuse(BackApplyInfo record);
|
int refuse(BackApplyInfo record);
|
||||||
|
|
||||||
|
void updateBackInfo(Integer parentId,String companyId);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -205,4 +205,9 @@ public class BackApplyServiceImpl implements BackApplyService {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateBackInfo(Integer parentId,String companyId) {
|
||||||
|
backApplyMapper.updateBackInfo(parentId,companyId);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -215,22 +215,8 @@ public class LeaseOutDetailsServiceImpl implements LeaseOutDetailsService {
|
||||||
// 插入领料出库明细表(lease_out_details)
|
// 插入领料出库明细表(lease_out_details)
|
||||||
res = leaseOutDetailsMapper.insertSelective(record);
|
res = leaseOutDetailsMapper.insertSelective(record);
|
||||||
if (res > 0) {
|
if (res > 0) {
|
||||||
if (record.getManageType() == 2) {
|
|
||||||
// 成套机具减少 (ma_type 设备规格表)的库存数量
|
|
||||||
res = leaseOutDetailsMapper.updateMaTypeStockNum(record);
|
|
||||||
// 成套机具减少 (ma_type 设备规格表)配件的库存数量
|
|
||||||
List<TmTask> typeIds = leaseOutDetailsMapper.getMaTypeDetails(record);
|
|
||||||
typeIds.removeIf(item -> item == null);
|
|
||||||
for (TmTask typeId : typeIds) {
|
|
||||||
MachinePart machinePart = leaseOutDetailsMapper.getMachineParts(typeId);
|
|
||||||
machinePart.setPartNum((typeId.getPartNum() * record.getOutNum()));
|
|
||||||
typeId.setNum(machinePart.getNum() - machinePart.getPartNum());
|
|
||||||
res = leaseOutDetailsMapper.updateMaTypeStockNumCt(typeId);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
// 普通机具减少 (ma_type 设备规格表)的库存数量
|
// 普通机具减少 (ma_type 设备规格表)的库存数量
|
||||||
res = leaseOutDetailsMapper.updateMaTypeStockNum(record);
|
res = leaseOutDetailsMapper.updateMaTypeStockNum(record);
|
||||||
}
|
|
||||||
// 更新 (ma_machine 设备表)的状态
|
// 更新 (ma_machine 设备表)的状态
|
||||||
leaseOutDetailsMapper.updateMaMachineStatus(record);
|
leaseOutDetailsMapper.updateMaMachineStatus(record);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -337,6 +337,9 @@
|
||||||
WHERE
|
WHERE
|
||||||
bai.id = #{id}
|
bai.id = #{id}
|
||||||
</update>
|
</update>
|
||||||
|
<update id="updateBackInfo">
|
||||||
|
update back_apply_info set company_id = #{companyId} where id = #{parentId}
|
||||||
|
</update>
|
||||||
|
|
||||||
<delete id="del">
|
<delete id="del">
|
||||||
DELETE
|
DELETE
|
||||||
|
|
|
||||||
|
|
@ -83,6 +83,7 @@
|
||||||
and mws.create_time BETWEEN CONCAT(#{startTime}, ' 00:00:00') AND CONCAT(#{endTime}, ' 23:59:59')
|
and mws.create_time BETWEEN CONCAT(#{startTime}, ' 00:00:00') AND CONCAT(#{endTime}, ' 23:59:59')
|
||||||
</if>
|
</if>
|
||||||
GROUP BY mws.parent_id,mws.whole_type_name
|
GROUP BY mws.parent_id,mws.whole_type_name
|
||||||
|
order by mws.create_time desc
|
||||||
</select>
|
</select>
|
||||||
<select id="selectListById" resultType="com.bonus.sgzb.material.domain.MaWholeVo">
|
<select id="selectListById" resultType="com.bonus.sgzb.material.domain.MaWholeVo">
|
||||||
SELECT
|
SELECT
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue