jsk 配件管理 解决配件查询不到库存的问题
This commit is contained in:
parent
d5c0780d0d
commit
d5c8fefe79
|
|
@ -88,4 +88,6 @@ public class PartTypeQueryDto {
|
|||
*/
|
||||
@ApiModelProperty(value = "子任务状态列表")
|
||||
private List<Integer> statusList;
|
||||
|
||||
private Long companyId;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ public interface PartArrivedMapper
|
|||
* @param partName 查询配件类型三级树
|
||||
* @return 查询配件类型三级树
|
||||
*/
|
||||
List<PartTypeDto> getTypeTree(String partName);
|
||||
List<PartTypeDto> getTypeTree(@Param("partName") String partName,@Param("companyId")Long companyId);
|
||||
|
||||
/**
|
||||
* 查询当年当月最大任务序号,用于生成任务编号 by 分类型查询
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@ import com.bonus.common.biz.domain.BmFileInfo;
|
|||
import com.bonus.material.basic.mapper.BmFileInfoMapper;
|
||||
import com.bonus.material.countersign.domain.SignProcessVo;
|
||||
import com.bonus.material.countersign.mapper.SignProcessMapper;
|
||||
import com.bonus.material.ma.service.ITypeService;
|
||||
import com.bonus.material.part.domain.*;
|
||||
import com.bonus.material.part.mapper.PartArrivedMapper;
|
||||
import com.bonus.material.part.service.IPartArrivedService;
|
||||
|
|
@ -49,6 +50,9 @@ public class PartArrivedServiceImpl implements IPartArrivedService
|
|||
@Resource
|
||||
private SignProcessMapper signProcessMapper;
|
||||
|
||||
@Resource
|
||||
private ITypeService iTypeService;
|
||||
|
||||
// 引入新购任务阶段常量
|
||||
private static final int PURCHASE_TASK_STAGE_MANAGE = 1;
|
||||
private static final int PURCHASE_TASK_STAGE_CHECK = 2;
|
||||
|
|
@ -61,7 +65,8 @@ public class PartArrivedServiceImpl implements IPartArrivedService
|
|||
*/
|
||||
@Override
|
||||
public List<PartTypeDto> getTypeTree(Long partId, String partName) {
|
||||
List<PartTypeDto> maTypes = partArrivedMapper.getTypeTree("");
|
||||
Long companyId=iTypeService.getUserDeptId();
|
||||
List<PartTypeDto> maTypes = partArrivedMapper.getTypeTree("",companyId);
|
||||
List<PartTypeDto> list = new ArrayList<>();
|
||||
for (PartTypeDto maType : maTypes) {
|
||||
if (maType.getParentId() == 0) {
|
||||
|
|
@ -117,9 +122,11 @@ public class PartArrivedServiceImpl implements IPartArrivedService
|
|||
partArrivedMapper.insertTmTask(tmTask);
|
||||
Long taskId = tmTask.getTaskId();
|
||||
partTypeCheckDto.getPartTypeCheckInfo().setTaskId(taskId);
|
||||
Long companyId=iTypeService.getUserDeptId();
|
||||
partTypeCheckDto.getPartTypeCheckInfo().setCompanyId(companyId);
|
||||
final int count = partArrivedMapper.insertPartTypeCheckInfo(partTypeCheckDto.getPartTypeCheckInfo());
|
||||
if (0 < count) {
|
||||
return insertPartTypeCheckDetails(partTypeCheckDto.getPartTypeCheckDetailsList(), taskId);
|
||||
return insertPartTypeCheckDetails(partTypeCheckDto.getPartTypeCheckDetailsList(), taskId,companyId);
|
||||
} else {
|
||||
return AjaxResult.error("新增任务失败,purchase_part_info表插入0条");
|
||||
}
|
||||
|
|
@ -130,12 +137,13 @@ public class PartArrivedServiceImpl implements IPartArrivedService
|
|||
}
|
||||
}
|
||||
|
||||
private AjaxResult insertPartTypeCheckDetails(List<PartTypeCheckDetails> partTypeCheckDetailsList, Long taskId) {
|
||||
private AjaxResult insertPartTypeCheckDetails(List<PartTypeCheckDetails> partTypeCheckDetailsList, Long taskId,Long companyId) {
|
||||
if (!CollectionUtils.isEmpty(partTypeCheckDetailsList)) {
|
||||
for (PartTypeCheckDetails details : partTypeCheckDetailsList) {
|
||||
details.setTaskId(taskId);
|
||||
details.setStatus(1);
|
||||
details.setInputStatus("0");
|
||||
details.setCompanyId(companyId);
|
||||
final List<BmFileInfo> bmFileInfos = details.getBmFileInfos();
|
||||
if (!CollectionUtils.isEmpty(bmFileInfos)) {
|
||||
bmFileInfos.forEach(o -> o.setTaskId(taskId));
|
||||
|
|
@ -176,6 +184,8 @@ public class PartArrivedServiceImpl implements IPartArrivedService
|
|||
*/
|
||||
@Override
|
||||
public List<PartTypeCheckInfo> selectPartTypeCheckInfoList(PartTypeQueryDto partTypeQueryDto) {
|
||||
Long companyId=iTypeService.getUserDeptId();
|
||||
partTypeQueryDto.setCompanyId(companyId);
|
||||
List<PartTypeCheckInfo> partTypeCheckInfos = partArrivedMapper.selectPartTypeCheckInfoJoinList(partTypeQueryDto);
|
||||
List<PartTypeCheckInfo> purchaseCheckInfoResult = new ArrayList<>();
|
||||
for (int i = 0; i < partTypeCheckInfos.size(); i++) {
|
||||
|
|
@ -408,7 +418,8 @@ public class PartArrivedServiceImpl implements IPartArrivedService
|
|||
if (res == 0) {
|
||||
throw new ServiceException("修改失败");
|
||||
}
|
||||
insertPartTypeCheckDetails(partTypeCheckDto.getPartTypeCheckDetailsList(), partTypeCheckDto.getPartTypeCheckInfo().getTaskId());
|
||||
Long companyId=iTypeService.getUserDeptId();
|
||||
insertPartTypeCheckDetails(partTypeCheckDto.getPartTypeCheckDetailsList(), partTypeCheckDto.getPartTypeCheckInfo().getTaskId(),companyId);
|
||||
}
|
||||
return true;
|
||||
} catch (final Exception e) {
|
||||
|
|
|
|||
|
|
@ -36,6 +36,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
from ma_part_type m
|
||||
where
|
||||
m.del_flag = '0'
|
||||
<if test="companyId != null and companyId !=''">
|
||||
and m.company_id = #{companyId}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="getMonthMaxOrderByDate" resultType="java.lang.Integer">
|
||||
|
|
@ -140,6 +143,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
|
||||
<![CDATA[and DATE_FORMAT( ppi.arrival_time, '%Y-%m-%d' ) BETWEEN #{startTime} AND #{endTime} ]]>
|
||||
</if>
|
||||
<if test="companyId != null">
|
||||
and ppi.company_id = #{companyId}
|
||||
</if>
|
||||
and t.task_status!=12
|
||||
</where>
|
||||
order by ppi.create_time desc
|
||||
|
|
|
|||
Loading…
Reference in New Issue