功能修复

This commit is contained in:
hayu 2024-03-22 18:00:57 +08:00
parent 7ea2a43140
commit c96e26c635
21 changed files with 228 additions and 65 deletions

View File

@ -59,7 +59,7 @@ public class PurchaseInputController extends BaseController {
}
/**
* 修改新购验收编号管理,暂时不用
* 审核
*/
@ApiOperation(value = "修改编码管理的入库状态")
@PostMapping("/manageStatus")

View File

@ -119,4 +119,16 @@ public interface PurchaseInputMapper {
* @return 结果
*/
int updateTmTask(TmTask task);
/**
* 判断是否全部已操作不通过或通过
* @param taskId
* @return int
*/
int isOperateAll(Long taskId);
/**
* 是否为全部不通过
* @param taskId
* @return
*/
int selectPurchaseCheckDetailsStatus(Long taskId);
}

View File

@ -90,16 +90,37 @@ public class PurchaseInputServiceImpl implements PurchaseInputService {
// 新增入库记录
purchaseInputMapper.insertMaInputRecord(maInputRecord);
}
// 当全部为已入库的时候任务改为入库状态
Integer count = purchaseInputMapper.selectMacodeInfoStatusByTaskId(taskId);
if (count <= 0) {
TmTask task = new TmTask();
task.setTaskId(taskId);
task.setTaskStatus(28);
task.setUpdateBy(String.valueOf(SecurityUtils.getLoginUser().getUserid()));
task.setUpdateTime(DateUtils.getNowDate());
purchaseInputMapper.updateTmTask(task);
//判断是否全部已操作通过或不通过
int count=purchaseInputMapper.isOperateAll(taskId);
if (count<=0){
//是否为全部不通过
int count1 = purchaseInputMapper.selectPurchaseCheckDetailsStatus(taskId);
if (count1>0){
TmTask task = new TmTask();
task.setTaskId(taskId);
task.setTaskStatus(28);
task.setUpdateBy(String.valueOf(SecurityUtils.getLoginUser().getUserid()));
task.setUpdateTime(DateUtils.getNowDate());
purchaseInputMapper.updateTmTask(task);
}else {
TmTask task = new TmTask();
task.setTaskId(taskId);
task.setTaskStatus(107);
task.setUpdateBy(String.valueOf(SecurityUtils.getLoginUser().getUserid()));
task.setUpdateTime(DateUtils.getNowDate());
purchaseInputMapper.updateTmTask(task);
}
}
// // 当全部为已入库的时候任务改为入库状态
// Integer count = purchaseInputMapper.selectMacodeInfoStatusByTaskId(taskId);
// if (count <= 0) {
// TmTask task = new TmTask();
// task.setTaskId(taskId);
// task.setTaskStatus(28);
// task.setUpdateBy(String.valueOf(SecurityUtils.getLoginUser().getUserid()));
// task.setUpdateTime(DateUtils.getNowDate());
// purchaseInputMapper.updateTmTask(task);
// }
return 1;
}
}

View File

@ -8,6 +8,7 @@ import com.bonus.sgzb.base.domain.vo.DictVo;
import com.bonus.sgzb.base.mapper.RepairMapper;
import com.bonus.sgzb.base.service.RepairService;
import com.bonus.sgzb.common.core.exception.ServiceException;
import com.bonus.sgzb.common.core.utils.StringUtils;
import com.bonus.sgzb.common.core.web.domain.AjaxResult;
import com.bonus.sgzb.common.security.utils.SecurityUtils;
import com.bonus.sgzb.system.api.domain.SysUser;
@ -131,19 +132,25 @@ public class RepairServiceImpl implements RepairService {
}
for (RepairPartDetails partDetails : partList){
if (sfPart.equals(partDetails.getPartType())){
if (StringUtils.isEmpty(partDetails.getPartCost())){
partDetails.setPartCost("0");
}
BigDecimal partCost = new BigDecimal(partDetails.getPartCost());
sfCosts = sfCosts.add(partCost);
} else if (bsfPart.equals(partDetails.getPartType())) {
if (StringUtils.isEmpty(partDetails.getPartCost())){
partDetails.setPartCost("0");
}
BigDecimal partCost = new BigDecimal(partDetails.getPartCost());
bsfCosts = bsfCosts.add(partCost);
} else{
throw new ServiceException("请选择配件收费类型");
}
}
if (!sfCosts.toString().equals("0")){
if (!"0".equals(sfCosts.toString())){
mapper.addRepairCost(bean,sfCosts,sfPart);
}
if (!bsfCosts.toString().equals("0")){
if (!"0".equals(bsfCosts.toString())){
mapper.addRepairCost(bean,bsfCosts,bsfPart);
}
}

View File

@ -164,4 +164,20 @@
<select id="selectMacodeInfoStatusByTaskId" resultType="java.lang.Integer">
select count(*) from purchase_macode_info where task_id = #{taskId} and status not in ('1','2')
</select>
<select id="isOperateAll" resultType="java.lang.Integer">
SELECT
count(*)
FROM
purchase_check_details
WHERE
task_id = #{taskId} and (status = 1 or status=6)
</select>
<select id="selectPurchaseCheckDetailsStatus" resultType="java.lang.Integer">
SELECT
count(*)
FROM
purchase_check_details
WHERE
task_id = #{taskId} and status =4
</select>
</mapper>

View File

@ -85,10 +85,11 @@ public class PurchaseCheckDetailsController extends BaseController
}
/**
* 修改新购验收任务详细
* 验收审核
* 通过/不通过
*/
@ApiOperation(value = "修改新购验收任务详细")
@Log(title = "修改新购验收任务详细", businessType = BusinessType.UPDATE)
@ApiOperation(value = "验收审核")
@Log(title = "验收审核", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody List<PurchaseCheckDetails> purchaseCheckDetailsList)
{

View File

@ -69,9 +69,9 @@ public class PurchaseCheckServiceCenterController extends BaseController
}
/**
* 修改新购验收编号管理,暂时不用
* 审核-通过/不通过
*/
@ApiOperation(value = "修改编码管理的入库状态")
@ApiOperation(value = "综合服务中心审核")
@PutMapping("/manageStatus")
public AjaxResult modifyManageStatus(@RequestBody MaInputVO maInputVO) throws Exception {
return toAjax(purchaseCheckServiceCenterService.modifyManageStatus(maInputVO));

View File

@ -103,9 +103,10 @@ public class PurchaseMacodeInfoController extends BaseController {
}
/**
* 修改新购验收编号管理,暂时不用
* 新购入库审核
* 通过/不通过
*/
@ApiOperation(value = "修改编码管理的入库状态")
@ApiOperation(value = "新购入库审核")
@PutMapping("/manageStatus")
public AjaxResult modifyManageStatus(@RequestBody MaInputVO maInputVO) throws Exception {
return toAjax(purchaseMacodeInfoService.modifyManageStatus(maInputVO));

View File

@ -264,4 +264,17 @@ public interface PurchaseMacodeInfoMapper {
List<PurchaseMacodeInfo> warehousingEntry(PurchaseMacodeInfo purchaseMacodeInfo);
List<PurchaseMacodeInfo> selectPutinDetailsAddTypeId(PurchaseMacodeInfo purchaseMacodeInfo);
/**
* 判断是否全部已操作不通过或通过
* @param taskId
* @return int
*/
int isOperateAll(Long taskId);
/**
* 是否为全部不通过
* @param taskId
* @return
*/
int selectPurchaseCheckDetailsStatus(Long taskId);
}

View File

@ -37,9 +37,9 @@ public interface IPurchaseCheckDetailsService
public int insertPurchaseCheckDetails(List<PurchaseCheckDetails> purchaseCheckDetailsList);
/**
* 修改新购验收任务详细purchase_check_details
* 验收审核
*
* @param purchaseCheckDetailsList 新购验收任务详细purchase_check_details
* @param purchaseCheckDetailsList
* @return 结果
*/
public int updatePurchaseCheckDetails(List<PurchaseCheckDetails> purchaseCheckDetailsList);

View File

@ -79,7 +79,7 @@ public interface IPurchaseMacodeInfoService
*/
int deletePurchaseMacodeInfoById(Long id);
/**
* 修改编码管理的入库状态
* 新购入库审核 通过/不通过
* @param maInputVO
* @return
*/

View File

@ -110,7 +110,8 @@ public interface PurchaseCheckServiceCenterService
List<PurchaseMacodeInfo> selectPutinDetails(PurchaseMacodeInfo purchaseMacodeInfo);
/**
* 修改编码管理的入库状态
* 综合服务中心审核
* 审核-通过/不通过
* @param maInputVO
* @return
*/

View File

@ -65,10 +65,8 @@ public class PurchaseCheckDetailsServiceImpl implements IPurchaseCheckDetailsSer
}
/**
* 修改新购验收任务详细purchase_check_details
*
* @param purchaseCheckDetailsList 新购验收任务详细purchase_check_details
* @return 结果
* 验收审核
* 通过/不通过
*/
@Override
@Transactional(rollbackFor = Exception.class)

View File

@ -18,6 +18,7 @@ import com.bonus.sgzb.common.core.utils.DateUtils;
import com.bonus.sgzb.material.vo.EquipmentNumberVO;
import com.bonus.sgzb.material.vo.GlobalContants;
import com.bonus.sgzb.material.vo.MaInputVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@ -45,6 +46,7 @@ public class PurchaseMacodeInfoServiceImpl implements IPurchaseMacodeInfoService
private PurchaseCheckDetailsMapper checkDetailsMapper;
/**
* 查询新购验收编号管理
*
@ -261,10 +263,8 @@ public class PurchaseMacodeInfoServiceImpl implements IPurchaseMacodeInfoService
}
/**
* 修改编码管理的入库状态,暂时不用
*
* @param maInputVO 入库信息
* @return 结果
* 新购入库审核
* 通过/不通过
*/
@Override
public int modifyManageStatus(MaInputVO maInputVO) {
@ -337,20 +337,45 @@ public class PurchaseMacodeInfoServiceImpl implements IPurchaseMacodeInfoService
}
}
// 当全部审核的时候任务改为入库状态
Integer count = purchaseMacodeInfoMapper.selectMacodeInfoStatusByTaskId(taskId);
if (count <= 0) {
TmTask task = new TmTask();
task.setTaskId(taskId);
task.setTaskStatus(28);
task.setUpdateBy(String.valueOf(SecurityUtils.getLoginUser().getUserid()));
task.setUpdateTime(DateUtils.getNowDate());
taskMapper.updateTmTask(task);
//判断是否全部已操作通过或不通过
int count=purchaseMacodeInfoMapper.isOperateAll(taskId);
if (count<=0){
//是否为全部不通过
int count1 = purchaseMacodeInfoMapper.selectPurchaseCheckDetailsStatus(taskId);
if (count1>0){
TmTask task = new TmTask();
task.setTaskId(taskId);
task.setTaskStatus(28);
task.setUpdateBy(String.valueOf(SecurityUtils.getLoginUser().getUserid()));
task.setUpdateTime(DateUtils.getNowDate());
taskMapper.updateTmTask(task);
}else {
TmTask task = new TmTask();
task.setTaskId(taskId);
task.setTaskStatus(107);
task.setUpdateBy(String.valueOf(SecurityUtils.getLoginUser().getUserid()));
task.setUpdateTime(DateUtils.getNowDate());
taskMapper.updateTmTask(task);
}
}
// // 当全部审核的时候任务改为入库状态
// Integer count = purchaseMacodeInfoMapper.selectMacodeInfoStatusByTaskId(taskId);
// if (count <= 0) {
// TmTask task = new TmTask();
// task.setTaskId(taskId);
// task.setTaskStatus(28);
// task.setUpdateBy(String.valueOf(SecurityUtils.getLoginUser().getUserid()));
// task.setUpdateTime(DateUtils.getNowDate());
// taskMapper.updateTmTask(task);
// }
return 1;
}
private List<PurchaseMacodeInfo> selectPutinDetailsAddTypeId(PurchaseMacodeInfo purchaseMacodeInfo) {
return purchaseMacodeInfoMapper.selectPutinDetailsAddTypeId(purchaseMacodeInfo);
}
/**
* 根据机具编码删除编码

View File

@ -44,8 +44,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
left join tm_task tk on pcd.task_id = tk.task_id
where 1=1
<if test="taskId != null ">and pcd.task_id = #{taskId}</if>
<if test="keyWord != null and keyWord != ''">and (mt.type_name like concat('%',#{keyWord},'%')
or mt1.type_name like concat('%',#{keyWord}) or msi.supplier like concat('%',#{keyWord}))
<if test="keyWord != null and keyWord != ''">
and (mt.type_name like concat('%',#{keyWord},'%')
or mt1.type_name like concat('%',#{keyWord},'%') or msi.supplier like concat('%',#{keyWord},'%'))
</if>
<if test="typeId != null ">and pcd.type_id = #{typeId}</if>
<if test="purchasePrice != null and purchasePrice != ''">and pcd.purchase_price = #{purchasePrice}</if>

View File

@ -184,7 +184,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
left join (select id,name from sys_dic where p_id = 50) dict on tk.task_status = dict.id
left join sys_user su on pci.purchaser = su.user_id
LEFT JOIN sys_user us on us.user_id = tk.update_by
where task_type = 23 and tk.task_status in (26,28)
where task_type = 23 and tk.task_status in (26,28,107)
<if test="keyWord != null and keyWord != ''"> and tk.code like concat('%',#{keyWord},'%')</if>
<if test="purchaseTime != null and purchaseTime != ''"> and pci.purchase_time = #{purchaseTime}</if>
<if test="arrivalTime != null and arrivalTime != ''"> and pci.arrival_time = #{arrivalTime}</if>
@ -273,7 +273,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
left join (select id,name from sys_dic where p_id = 50) dict on tk.task_status = dict.id
left join sys_user su on pci.purchaser = su.user_id
LEFT JOIN sys_user us on us.user_id = tk.update_by
where task_type = 23 and tk.task_status in (105,28)
where task_type = 23 and tk.task_status in (105,28,107)
<if test="keyWord != null and keyWord != ''"> and tk.code like concat('%',#{keyWord},'%')</if>
<if test="purchaseTime != null and purchaseTime != ''"> and pci.purchase_time = #{purchaseTime}</if>
<if test="arrivalTime != null and arrivalTime != ''"> and pci.arrival_time = #{arrivalTime}</if>

View File

@ -276,7 +276,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
left join sys_user su on pci.purchaser = su.user_id
LEFT JOIN sys_user us on us.user_id = tk.update_by
LEFT JOIN purchase_check_details pcd on pcd.task_id=pci.task_id
where task_type = 23 and tk.task_status in (26,28,105,106)
where task_type = 23 and tk.task_status in (26,28,105,106,107)
<if test="keyWord != null and keyWord != ''">
and (tk.code like concat('%',#{keyWord},'%') or
su.user_name like concat('%',#{keyWord},'%')
@ -426,7 +426,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
FROM
purchase_check_details
WHERE
task_id = #{taskId} and status != 6 and status!=7
task_id = #{taskId} and status =1
</select>
<select id="selectPurchaseCheckDetailsStatus" resultType="java.lang.Integer">
SELECT

View File

@ -482,6 +482,22 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</if>
order by status
</select>
<select id="isOperateAll" resultType="java.lang.Integer">
SELECT
count(*)
FROM
purchase_check_details
WHERE
task_id = #{taskId} and (status = 1 or status=6)
</select>
<select id="selectPurchaseCheckDetailsStatus" resultType="java.lang.Integer">
SELECT
count(*)
FROM
purchase_check_details
WHERE
task_id = #{taskId} and status =4
</select>
<update id="updateTypeByTypeId">
update ma_type set num = #{num} where type_id = #{typeId}

View File

@ -22,6 +22,14 @@ public class PurchaseNoticePerson extends BaseEntity
@ApiModelProperty(value = "用户id")
private Long userId;
/** 部门id */
@ApiModelProperty(value = "用户id")
private Long deptId;
/** 用户昵称 */
@ApiModelProperty(value = "用户昵称")
private String nickName;
/** 用户名称 */
@ApiModelProperty(value = "用户名称")
private String userName;
@ -103,6 +111,22 @@ public class PurchaseNoticePerson extends BaseEntity
this.roleId = roleId;
}
public Long getDeptId() {
return deptId;
}
public void setDeptId(Long deptId) {
this.deptId = deptId;
}
public String getNickName() {
return nickName;
}
public void setNickName(String nickName) {
this.nickName = nickName;
}
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)

View File

@ -9,6 +9,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="userId" column="user_id" />
<result property="userName" column="user_name" />
<result property="telphone" column="telphone" />
<result property="nickName" column="nick_name" />
</resultMap>
<sql id="selectPurchaseNoticePersonVo">
@ -16,16 +17,25 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</sql>
<select id="selectPurchaseNoticePersonList" parameterType="com.bonus.sgzb.system.domain.PurchaseNoticePerson" resultMap="PurchaseNoticePersonResult">
select pnp.id, pnp.user_id, pnp.user_name, telphone,r.role_name,concat(d2.dept_name,'/',d1.dept_name,'/',d.dept_name) deptName
from purchase_notice_person pnp
left join sys_user u on pnp.user_id = u.user_id
left join sys_user_role sur on u.user_id = sur.user_id
left join sys_role r on sur.role_id = r.role_id
left join sys_dept d on u.dept_id = d.dept_id
left join sys_dept d1 on d.parent_id = d1.dept_id
left join sys_dept d2 on d1.parent_id = d2.dept_id
where u.status = '0'
SELECT
pnp.id,
pnp.user_id,
pnp.user_name,
u.nick_name,
telphone,
GROUP_CONCAT(r.role_name SEPARATOR '/') as role_name,
concat( d2.dept_name, '/', d1.dept_name, '/', d.dept_name ) deptName
FROM
purchase_notice_person pnp
LEFT JOIN sys_user u ON pnp.user_id = u.user_id
LEFT JOIN sys_user_role sur ON u.user_id = sur.user_id
LEFT JOIN sys_role r ON sur.role_id = r.role_id
LEFT JOIN sys_dept d ON u.dept_id = d.dept_id
LEFT JOIN sys_dept d1 ON d.parent_id = d1.dept_id
LEFT JOIN sys_dept d2 ON d1.parent_id = d2.dept_id
WHERE
u.STATUS = '0'
GROUP BY pnp.user_id
</select>
<select id="selectPurchaseNoticePersonById" parameterType="Long" resultMap="PurchaseNoticePersonResult">
@ -33,15 +43,31 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where id = #{id}
</select>
<select id="getUserByRoleList" resultType="com.bonus.sgzb.system.domain.PurchaseNoticePerson">
select u.user_id userId, u.dept_id deptId, u.nick_name nickName, u.user_name userName, u.avatar, u.phonenumber telphone,
concat(d2.dept_name,'/',d1.dept_name,'/',d.dept_name) deptName,r.role_name roleName
from sys_user u
left join sys_user_role sur on u.user_id = sur.user_id
left join sys_role r on sur.role_id = r.role_id
left join sys_dept d on u.dept_id = d.dept_id
left join sys_dept d1 on d.parent_id = d1.dept_id
left join sys_dept d2 on d1.parent_id = d2.dept_id
where u.status = '0' and u.del_flag = '0' and u.user_id not in (select user_id from purchase_notice_person)
SELECT
u.user_id userId,
u.dept_id deptId,
u.nick_name nickName,
u.user_name userName,
u.avatar,
u.phonenumber telphone,
concat( d2.dept_name, '/', d1.dept_name, '/', d.dept_name ) deptName,
GROUP_CONCAT(r.role_name SEPARATOR '/') as roleName
FROM
sys_user u
LEFT JOIN sys_user_role sur ON u.user_id = sur.user_id
LEFT JOIN sys_role r ON sur.role_id = r.role_id
LEFT JOIN sys_dept d ON u.dept_id = d.dept_id
LEFT JOIN sys_dept d1 ON d.parent_id = d1.dept_id
LEFT JOIN sys_dept d2 ON d1.parent_id = d2.dept_id
WHERE
u.STATUS = '0'
AND u.del_flag = '0'
AND u.user_id NOT IN (
SELECT
user_id
FROM
purchase_notice_person)
GROUP BY u.user_id
</select>
<insert id="insertPurchaseNoticePerson" parameterType="com.bonus.sgzb.system.domain.PurchaseNoticePerson">

View File

@ -74,6 +74,7 @@
<span v-if="scope.row.taskStatus=='105'">入库待审核</span>
<span v-if="scope.row.taskStatus=='106'">已驳回</span>
<span v-if="scope.row.taskStatus=='28'">已入库</span>
<span v-if="scope.row.taskStatus=='107'">入库驳回</span>
</template>
</el-table-column>
<el-table-column label="备注" align="center" prop="remark" :show-overflow-tooltip="true" />