新购验收部分
This commit is contained in:
parent
ee9d9e3a96
commit
ef3264da2b
|
|
@ -23,7 +23,7 @@ import java.util.List;
|
|||
* @since 2023-11-27 16:44:02
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("maPartType")
|
||||
@RequestMapping("/maPartType")
|
||||
public class MaPartTypeController extends BaseController {
|
||||
/**
|
||||
* 服务对象
|
||||
|
|
@ -37,11 +37,11 @@ public class MaPartTypeController extends BaseController {
|
|||
* @return
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(MaPartType maPartType)
|
||||
public AjaxResult list(MaPartType maPartType)
|
||||
{
|
||||
startPage();
|
||||
List<MaPartType> list = maPartTypeService.selectMaPartList(maPartType);
|
||||
return getDataTable(list);
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -102,7 +102,6 @@ public class PurchaseCheckInfoController extends BaseController
|
|||
* 验收通知
|
||||
*/
|
||||
@ApiOperation("验收通知")
|
||||
@Log(title = "验收通知", businessType = BusinessType.INSERT)
|
||||
@PostMapping("/bmNoticeInfo")
|
||||
public AjaxResult bmNoticeInfo(@RequestBody NoticeInfoVO noticeInfoVO) throws Exception {
|
||||
return toAjax(purchaseCheckInfoService.insertBmNoticeInfo(noticeInfoVO));
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.bonus.sgzb.material.domain;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
import com.bonus.sgzb.common.core.web.domain.BaseEntity;
|
||||
|
|
@ -40,7 +41,7 @@ public class PurchaseCheckDetails extends BaseEntity
|
|||
|
||||
/** 验收数量 */
|
||||
@ApiModelProperty(value = "验收数量")
|
||||
private Long checkNum;
|
||||
private BigDecimal checkNum;
|
||||
|
||||
/** 验收结论 */
|
||||
@ApiModelProperty(value = "验收结论")
|
||||
|
|
@ -65,7 +66,7 @@ public class PurchaseCheckDetails extends BaseEntity
|
|||
|
||||
/** 入库数量 */
|
||||
@ApiModelProperty(value = "入库数量")
|
||||
private double inputNum;
|
||||
private BigDecimal inputNum;
|
||||
|
||||
/** 验收图片 */
|
||||
@ApiModelProperty(value = "验收图片")
|
||||
|
|
@ -96,6 +97,12 @@ public class PurchaseCheckDetails extends BaseEntity
|
|||
@ApiModelProperty(value = "机具类型名称")
|
||||
private String machineTypeName;
|
||||
|
||||
@ApiModelProperty(value = "管理方式(0编号 1计数)")
|
||||
private String manageType;
|
||||
|
||||
@ApiModelProperty(value = "采购单号")
|
||||
private String code;
|
||||
|
||||
public void setTaskId(Long taskId)
|
||||
{
|
||||
this.taskId = taskId;
|
||||
|
|
@ -184,11 +191,11 @@ public class PurchaseCheckDetails extends BaseEntity
|
|||
this.supplier = supplier;
|
||||
}
|
||||
|
||||
public Long getCheckNum() {
|
||||
public BigDecimal getCheckNum() {
|
||||
return checkNum;
|
||||
}
|
||||
|
||||
public void setCheckNum(Long checkNum) {
|
||||
public void setCheckNum(BigDecimal checkNum) {
|
||||
this.checkNum = checkNum;
|
||||
}
|
||||
|
||||
|
|
@ -248,14 +255,30 @@ public class PurchaseCheckDetails extends BaseEntity
|
|||
this.machineTypeName = machineTypeName;
|
||||
}
|
||||
|
||||
public double getInputNum() {
|
||||
public BigDecimal getInputNum() {
|
||||
return inputNum;
|
||||
}
|
||||
|
||||
public void setInputNum(double inputNum) {
|
||||
public void setInputNum(BigDecimal inputNum) {
|
||||
this.inputNum = inputNum;
|
||||
}
|
||||
|
||||
public String getManageType() {
|
||||
return manageType;
|
||||
}
|
||||
|
||||
public void setManageType(String manageType) {
|
||||
this.manageType = manageType;
|
||||
}
|
||||
|
||||
public String getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public void setCode(String code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
|
||||
|
|
|
|||
|
|
@ -69,4 +69,6 @@ public interface PurchaseCheckDetailsMapper {
|
|||
int selectPurchaseCheckDetailsStatus(Long taskId);
|
||||
|
||||
int deleteCheckDetailsByTaskId(Long taskId);
|
||||
|
||||
int updateByTaskIdTypeId(PurchaseCheckDetails purchaseCheckDetails);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ package com.bonus.sgzb.material.mapper;
|
|||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.bonus.sgzb.base.api.domain.MaMachine;
|
||||
import com.bonus.sgzb.base.api.domain.MaType;
|
||||
import com.bonus.sgzb.material.domain.MaInputRecord;
|
||||
import com.bonus.sgzb.material.domain.PurchaseMacodeInfo;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
|
@ -81,4 +82,11 @@ public interface PurchaseMacodeInfoMapper {
|
|||
Integer selectMacodeInfoStatusByTaskId(Long taskId);
|
||||
|
||||
int insertMaInputRecord(MaInputRecord maInputRecord);
|
||||
|
||||
MaType selectTypeByTypeId(Long typeId);
|
||||
|
||||
int updateTypeByTypeId(MaType maType);
|
||||
|
||||
int updateMaMachine(MaMachine maMachine);
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ package com.bonus.sgzb.material.mapper;
|
|||
|
||||
import com.bonus.sgzb.base.api.domain.TmTask;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
|
@ -14,8 +15,7 @@ import java.util.List;
|
|||
* @date 2023-12-13
|
||||
*/
|
||||
@Mapper
|
||||
public interface TaskMapper
|
||||
{
|
||||
public interface TaskMapper {
|
||||
/**
|
||||
* 查询任务tm_task
|
||||
*
|
||||
|
|
@ -64,5 +64,5 @@ public interface TaskMapper
|
|||
*/
|
||||
public int deleteTmTaskByTaskIds(Long[] taskIds);
|
||||
|
||||
int selectTaskNumByMonth(Date date);
|
||||
int selectTaskNumByMonth(@Param("date") Date date, @Param("taskType") Integer taskType);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -79,10 +79,12 @@ public class PurchaseCheckDetailsServiceImpl implements IPurchaseCheckDetailsSer
|
|||
if ("通过".equals(purchaseCheckDetails.getCheckResult())) {
|
||||
purchaseCheckDetails.setStatus(1);
|
||||
// 通过之后往编码管理表里回填数据
|
||||
PurchaseMacodeInfo macodeInfo = new PurchaseMacodeInfo();
|
||||
macodeInfo.setTypeId(purchaseCheckDetails.getTypeId());
|
||||
macodeInfo.setTaskId(taskId);
|
||||
macodeInfoService.insertPurchaseMacodeInfo(macodeInfo);
|
||||
if ("0".equals(purchaseCheckDetails.getManageType())) {
|
||||
PurchaseMacodeInfo macodeInfo = new PurchaseMacodeInfo();
|
||||
macodeInfo.setTypeId(purchaseCheckDetails.getTypeId());
|
||||
macodeInfo.setTaskId(taskId);
|
||||
macodeInfoService.insertPurchaseMacodeInfo(macodeInfo);
|
||||
}
|
||||
} else if ("不通过".equals(purchaseCheckDetails.getCheckResult())) {
|
||||
purchaseCheckDetails.setStatus(0);
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -134,7 +134,7 @@ public class PurchaseCheckInfoServiceImpl implements IPurchaseCheckInfoService
|
|||
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
|
||||
Date nowDate = DateUtils.getNowDate();
|
||||
String format = dateFormat.format(nowDate);
|
||||
int taskNum = taskMapper.selectTaskNumByMonth(nowDate) + 1;
|
||||
int taskNum = taskMapper.selectTaskNumByMonth(nowDate,23) + 1;
|
||||
String code = "XG" + format + "-000" + taskNum;
|
||||
return code;
|
||||
}
|
||||
|
|
@ -205,7 +205,11 @@ public class PurchaseCheckInfoServiceImpl implements IPurchaseCheckInfoService
|
|||
TmTask task = new TmTask();
|
||||
Long taskId = noticeInfoVO.getTaskId();
|
||||
if (taskId == null) {
|
||||
throw new Exception("任务taskId为空");
|
||||
throw new Exception("任务taskId为空!!");
|
||||
}
|
||||
TmTask task1 = taskMapper.selectTmTaskByTaskId(taskId);
|
||||
if (task1.getTaskStatus() != 24) {
|
||||
throw new Exception("任务状态不为待通知!!");
|
||||
}
|
||||
task.setTaskId(taskId);
|
||||
task.setTaskStatus(25);
|
||||
|
|
@ -218,11 +222,15 @@ public class PurchaseCheckInfoServiceImpl implements IPurchaseCheckInfoService
|
|||
if (bmNoticeInfoList.size() <= 0) {
|
||||
throw new Exception("绑定用户为空");
|
||||
}
|
||||
Boolean send = false;
|
||||
Boolean send = true;
|
||||
for (BmNoticeInfo bmNoticeInfo : bmNoticeInfoList) {
|
||||
bmNoticeInfo.setContent(message);
|
||||
bmNoticeInfo.setTaskId(taskId);
|
||||
bmNoticeInfo.setModelName("新购机具验收");
|
||||
bmNoticeInfo.setCreateTime(new Date());
|
||||
String phone = bmNoticeInfo.getPhone();
|
||||
// 短信通知
|
||||
send = remoteUserService.send(phone, message);
|
||||
// send = remoteUserService.send(phone, message);
|
||||
purchaseCheckInfoMapper.insertBmNoticeInfo(bmNoticeInfo);
|
||||
}
|
||||
return send;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.bonus.sgzb.material.service.impl;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
|
|
@ -7,13 +8,13 @@ import java.util.List;
|
|||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.bonus.sgzb.base.api.domain.MaMachine;
|
||||
import com.bonus.sgzb.base.api.domain.MaType;
|
||||
import com.bonus.sgzb.base.api.domain.TmTask;
|
||||
import com.bonus.sgzb.material.domain.BmQrcodeInfo;
|
||||
import com.bonus.sgzb.material.domain.MaInputRecord;
|
||||
import com.bonus.sgzb.material.domain.PurchaseCheckDetails;
|
||||
import com.bonus.sgzb.material.domain.PurchaseMacodeInfo;
|
||||
import com.bonus.sgzb.material.mapper.BmQrcodeInfoMapper;
|
||||
import com.bonus.sgzb.material.mapper.PurchaseMacodeInfoMapper;
|
||||
import com.bonus.sgzb.material.mapper.TaskMapper;
|
||||
import com.bonus.sgzb.material.mapper.*;
|
||||
import com.bonus.sgzb.material.service.IPurchaseMacodeInfoService;
|
||||
import com.bonus.sgzb.common.core.utils.DateUtils;
|
||||
import com.bonus.sgzb.material.vo.EquipmentNumberVO;
|
||||
|
|
@ -39,6 +40,9 @@ public class PurchaseMacodeInfoServiceImpl implements IPurchaseMacodeInfoService
|
|||
@Resource
|
||||
private BmQrcodeInfoMapper qrcodeInfoMapper;
|
||||
|
||||
@Resource
|
||||
private PurchaseCheckDetailsMapper checkDetailsMapper;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
|
|
@ -197,10 +201,30 @@ public class PurchaseMacodeInfoServiceImpl implements IPurchaseMacodeInfoService
|
|||
@Override
|
||||
public int modifyManageStatus(MaInputRecord maInputRecord) {
|
||||
Long taskId = maInputRecord.getTaskId();
|
||||
Long typeId = maInputRecord.getTypeId();
|
||||
String checkResult = maInputRecord.getCheckResult();
|
||||
List<Long> maCodeInfoIdList = maInputRecord.getMaCodeInfoIdList();
|
||||
// 修改编码管理的入库状态
|
||||
for (Long maCodeInfoId : maCodeInfoIdList) {
|
||||
MaType maType = purchaseMacodeInfoMapper.selectTypeByTypeId(typeId);
|
||||
// 库存添加
|
||||
maType.setNum(String.valueOf(maInputRecord.getInputNum().add(new BigDecimal(Integer.parseInt(maType.getNum())))));
|
||||
purchaseMacodeInfoMapper.updateTypeByTypeId(maType);
|
||||
|
||||
// 修改机具入库状态
|
||||
MaMachine maMachine = new MaMachine();
|
||||
maMachine.setMaId(maInputRecord.getMaId());
|
||||
maMachine.setMaStatus("15");
|
||||
purchaseMacodeInfoMapper.updateMaMachine(maMachine);
|
||||
|
||||
// 修改验收任务详细表入库数量
|
||||
PurchaseCheckDetails purchaseCheckDetails = new PurchaseCheckDetails();
|
||||
purchaseCheckDetails.setTaskId(taskId);
|
||||
purchaseCheckDetails.setTypeId(typeId);
|
||||
purchaseCheckDetails.setInputNum(maInputRecord.getInputNum());
|
||||
checkDetailsMapper.updateByTaskIdTypeId(purchaseCheckDetails);
|
||||
|
||||
// 修改编码管理表入库状态
|
||||
PurchaseMacodeInfo purchaseMacodeInfo = new PurchaseMacodeInfo();
|
||||
purchaseMacodeInfo.setId(maCodeInfoId);
|
||||
purchaseMacodeInfo.setTaskId(taskId);
|
||||
|
|
@ -210,6 +234,7 @@ public class PurchaseMacodeInfoServiceImpl implements IPurchaseMacodeInfoService
|
|||
purchaseMacodeInfoMapper.insertMaInputRecord(maInputRecord);
|
||||
}
|
||||
|
||||
// 当全部为已入库的时候任务改为入库状态
|
||||
Integer count = purchaseMacodeInfoMapper.selectMacodeInfoStatusByTaskId(taskId);
|
||||
if (count <= 0) {
|
||||
TmTask task = new TmTask();
|
||||
|
|
|
|||
|
|
@ -35,11 +35,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
select pcd.id,pcd.task_id, pcd.type_id, pcd.purchase_price, pcd.purchase_num, pcd.check_num, pcd.check_result,
|
||||
pcd.supplier_id, pcd.status, msi.supplier, pcd.create_by, pcd.production_time, pcd.create_time, pcd.check_url_name,
|
||||
pcd.check_url, pcd.file_name, pcd.file_url,pcd.update_by, pcd.update_time, pcd.remark, pcd.company_id,
|
||||
mt1.type_name machineTypeName,mt.type_name specificationType
|
||||
mt1.type_name machineTypeName,mt.type_name specificationType, mt.manage_type manageType, tk.code
|
||||
from purchase_check_details pcd
|
||||
left join ma_type mt on pcd.type_id = mt.type_id
|
||||
left join ma_type mt1 on mt.parent_id = mt1.type_id
|
||||
left join ma_supplier_info msi on pcd.supplier_id = msi.supplier_id
|
||||
left join tm_task tk on pcd.task_id = tk.task_id
|
||||
<where>
|
||||
<if test="taskId != null "> and pcd.task_id = #{taskId}</if>
|
||||
<if test="typeId != null "> and pcd.type_id = #{typeId}</if>
|
||||
|
|
@ -198,4 +199,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<delete id="deleteCheckDetailsByTaskId">
|
||||
delete from purchase_check_details where task_id = #{taskId}
|
||||
</delete>
|
||||
|
||||
<update id="updateByTaskIdTypeId">
|
||||
update purchase_check_details set check_num = #{checkNum} where task_id = #{taskId} and type_id = #{typeId}
|
||||
</update>
|
||||
</mapper>
|
||||
|
|
@ -37,8 +37,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</select>
|
||||
|
||||
<select id="selectPurchaseCheckInfoByTaskId" parameterType="Long" resultMap="PurchaseCheckInfoResult">
|
||||
<include refid="selectPurchaseCheckInfoVo"/>
|
||||
where task_id = #{taskId}
|
||||
select pci.id,pci.task_id, pci.purchase_time, pci.arrival_time, pci.purchaser, pci.create_by, pci.create_time,
|
||||
pci.update_by, pci.update_time, pci.remark, pci.company_id, tk.code
|
||||
from purchase_check_info pci
|
||||
left join tm_task tk on pci.task_id = tk.task_id
|
||||
where pci.task_id = #{taskId}
|
||||
</select>
|
||||
|
||||
<insert id="insertPurchaseCheckInfo" parameterType="com.bonus.sgzb.material.domain.PurchaseCheckInfo" useGeneratedKeys="true" keyProperty="taskId">
|
||||
|
|
|
|||
|
|
@ -227,4 +227,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="companyId != null">#{companyId},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<select id="selectTypeByTypeId" resultType="com.bonus.sgzb.base.api.domain.MaType">
|
||||
select type_id typeId, type_name, parent_id, status, num, unit_id, manage_type, lease_price, buy_price, pay_price,
|
||||
level, rated_load, test_load, holding_time, warn_num, del_flag, create_by,
|
||||
create_time, remark, company_id
|
||||
from ma_type where type_id = #{typeId}
|
||||
</select>
|
||||
|
||||
<update id="updateTypeByTypeId">
|
||||
update ma_type set num = #{num} where type_id = #{typeId}
|
||||
</update>
|
||||
|
||||
<update id="updateMaMachine">
|
||||
update ma_machine set ma_status = #{maStatus} where ma_id = #{maId}
|
||||
</update>
|
||||
</mapper>
|
||||
|
|
@ -90,6 +90,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</delete>
|
||||
|
||||
<select id="selectTaskNumByMonth" resultType="java.lang.Integer">
|
||||
select count(*) from tm_task where DATE_FORMAT(create_time,'%y%m') = DATE_FORMAT(#{date},'%y%m')
|
||||
select count(*) from tm_task where DATE_FORMAT(create_time,'%y%m') = DATE_FORMAT(#{date},'%y%m') and task_type = #{date}
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
@ -0,0 +1,71 @@
|
|||
package com.bonus.sgzb.system.controller;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.bonus.sgzb.common.log.annotation.Log;
|
||||
import com.bonus.sgzb.common.log.enums.BusinessType;
|
||||
import com.bonus.sgzb.common.security.annotation.RequiresPermissions;
|
||||
import com.bonus.sgzb.system.domain.PurchaseNoticePerson;
|
||||
import com.bonus.sgzb.system.service.IPurchaseNoticePersonService;
|
||||
import com.bonus.sgzb.common.core.web.controller.BaseController;
|
||||
import com.bonus.sgzb.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.sgzb.common.core.web.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 新购短信通知人员
|
||||
*
|
||||
* @author bonus
|
||||
* @date 2023-12-16
|
||||
*/
|
||||
@RestController
|
||||
@Api(value = "新购短信通知人员")
|
||||
@RequestMapping("/person")
|
||||
public class PurchaseNoticePersonController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IPurchaseNoticePersonService purchaseNoticePersonService;
|
||||
|
||||
/**
|
||||
* 查询新购短信通知人员列表
|
||||
*/
|
||||
@ApiOperation("查询新购短信通知人员")
|
||||
@GetMapping("/list")
|
||||
public AjaxResult list(PurchaseNoticePerson purchaseNoticePerson)
|
||||
{
|
||||
List<PurchaseNoticePerson> list = purchaseNoticePersonService.selectPurchaseNoticePersonList(purchaseNoticePerson);
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 新增新购短信通知人员purchase_notice_person
|
||||
*/
|
||||
@ApiOperation(value ="新增新购短信通知人员")
|
||||
@Log(title = "新购短信通知人员", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody PurchaseNoticePerson purchaseNoticePerson)
|
||||
{
|
||||
return toAjax(purchaseNoticePersonService.insertPurchaseNoticePerson(purchaseNoticePerson));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除新购短信通知人员
|
||||
*/
|
||||
@RequiresPermissions("删除新购短信通知人员")
|
||||
@Log(title = "删除新购短信通知人员", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{id}")
|
||||
public AjaxResult remove(@PathVariable Long id)
|
||||
{
|
||||
return toAjax(purchaseNoticePersonService.deletePurchaseNoticePersonById(id));
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,115 @@
|
|||
package com.bonus.sgzb.system.domain;
|
||||
|
||||
import com.bonus.sgzb.common.core.web.domain.BaseEntity;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
|
||||
/**
|
||||
* 新购短信通知人员对象
|
||||
*
|
||||
* @author bonus
|
||||
* @date 2023-12-16
|
||||
*/
|
||||
public class PurchaseNoticePerson extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** $column.columnComment */
|
||||
private Long id;
|
||||
|
||||
/** 用户id */
|
||||
@ApiModelProperty(value = "用户id")
|
||||
private Long userId;
|
||||
|
||||
/** 用户名称 */
|
||||
@ApiModelProperty(value = "用户名称")
|
||||
private String userName;
|
||||
|
||||
/** 手机号 */
|
||||
@ApiModelProperty(value = "手机号")
|
||||
private String telphone;
|
||||
|
||||
/** 用户角色 */
|
||||
@ApiModelProperty(value = "用户角色")
|
||||
private String roleName;
|
||||
|
||||
/** 用户角色 */
|
||||
@ApiModelProperty(value = "用户角色Id")
|
||||
private Long roleId;
|
||||
|
||||
/** 所属机构名称 */
|
||||
@ApiModelProperty(value = "所属机构名称")
|
||||
private String deptName;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
public void setUserId(Long userId)
|
||||
{
|
||||
this.userId = userId;
|
||||
}
|
||||
|
||||
public Long getUserId()
|
||||
{
|
||||
return userId;
|
||||
}
|
||||
public void setUserName(String userName)
|
||||
{
|
||||
this.userName = userName;
|
||||
}
|
||||
|
||||
public String getUserName()
|
||||
{
|
||||
return userName;
|
||||
}
|
||||
public void setTelphone(String telphone)
|
||||
{
|
||||
this.telphone = telphone;
|
||||
}
|
||||
|
||||
public String getTelphone()
|
||||
{
|
||||
return telphone;
|
||||
}
|
||||
|
||||
public String getRoleName() {
|
||||
return roleName;
|
||||
}
|
||||
|
||||
public void setRoleName(String roleName) {
|
||||
this.roleName = roleName;
|
||||
}
|
||||
|
||||
public String getDeptName() {
|
||||
return deptName;
|
||||
}
|
||||
|
||||
public void setDeptName(String deptName) {
|
||||
this.deptName = deptName;
|
||||
}
|
||||
|
||||
public Long getRoleId() {
|
||||
return roleId;
|
||||
}
|
||||
|
||||
public void setRoleId(Long roleId) {
|
||||
this.roleId = roleId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("userId", getUserId())
|
||||
.append("userName", getUserName())
|
||||
.append("telphone", getTelphone())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,63 @@
|
|||
package com.bonus.sgzb.system.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.bonus.sgzb.system.domain.PurchaseNoticePerson;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 新购短信通知人员purchase_notice_personMapper接口
|
||||
*
|
||||
* @author bonus
|
||||
* @date 2023-12-16
|
||||
*/
|
||||
@Mapper
|
||||
public interface PurchaseNoticePersonMapper
|
||||
{
|
||||
/**
|
||||
* 查询新购短信通知人员purchase_notice_person
|
||||
*
|
||||
* @param id 新购短信通知人员purchase_notice_person主键
|
||||
* @return 新购短信通知人员purchase_notice_person
|
||||
*/
|
||||
public PurchaseNoticePerson selectPurchaseNoticePersonById(Long id);
|
||||
|
||||
/**
|
||||
* 查询新购短信通知人员purchase_notice_person列表
|
||||
*
|
||||
* @param purchaseNoticePerson 新购短信通知人员purchase_notice_person
|
||||
* @return 新购短信通知人员purchase_notice_person集合
|
||||
*/
|
||||
public List<PurchaseNoticePerson> selectPurchaseNoticePersonList(PurchaseNoticePerson purchaseNoticePerson);
|
||||
|
||||
/**
|
||||
* 新增新购短信通知人员purchase_notice_person
|
||||
*
|
||||
* @param purchaseNoticePerson 新购短信通知人员purchase_notice_person
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertPurchaseNoticePerson(PurchaseNoticePerson purchaseNoticePerson);
|
||||
|
||||
/**
|
||||
* 修改新购短信通知人员purchase_notice_person
|
||||
*
|
||||
* @param purchaseNoticePerson 新购短信通知人员purchase_notice_person
|
||||
* @return 结果
|
||||
*/
|
||||
public int updatePurchaseNoticePerson(PurchaseNoticePerson purchaseNoticePerson);
|
||||
|
||||
/**
|
||||
* 删除新购短信通知人员purchase_notice_person
|
||||
*
|
||||
* @param id 新购短信通知人员purchase_notice_person主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deletePurchaseNoticePersonById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除新购短信通知人员purchase_notice_person
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deletePurchaseNoticePersonByIds(Long[] ids);
|
||||
}
|
||||
|
|
@ -0,0 +1,95 @@
|
|||
package com.bonus.sgzb.system.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.bonus.sgzb.system.mapper.PurchaseNoticePersonMapper;
|
||||
import com.bonus.sgzb.system.domain.PurchaseNoticePerson;
|
||||
import com.bonus.sgzb.system.service.IPurchaseNoticePersonService;
|
||||
|
||||
/**
|
||||
* 新购短信通知人员purchase_notice_personService业务层处理
|
||||
*
|
||||
* @author bonus
|
||||
* @date 2023-12-16
|
||||
*/
|
||||
@Service
|
||||
public class PurchaseNoticePersonServiceImpl implements IPurchaseNoticePersonService
|
||||
{
|
||||
@Autowired
|
||||
private PurchaseNoticePersonMapper purchaseNoticePersonMapper;
|
||||
|
||||
/**
|
||||
* 查询新购短信通知人员purchase_notice_person
|
||||
*
|
||||
* @param id 新购短信通知人员purchase_notice_person主键
|
||||
* @return 新购短信通知人员purchase_notice_person
|
||||
*/
|
||||
@Override
|
||||
public PurchaseNoticePerson selectPurchaseNoticePersonById(Long id)
|
||||
{
|
||||
return purchaseNoticePersonMapper.selectPurchaseNoticePersonById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询新购短信通知人员purchase_notice_person列表
|
||||
*
|
||||
* @param purchaseNoticePerson 新购短信通知人员purchase_notice_person
|
||||
* @return 新购短信通知人员purchase_notice_person
|
||||
*/
|
||||
@Override
|
||||
public List<PurchaseNoticePerson> selectPurchaseNoticePersonList(PurchaseNoticePerson purchaseNoticePerson)
|
||||
{
|
||||
List<PurchaseNoticePerson> purchaseNoticePeople = purchaseNoticePersonMapper.selectPurchaseNoticePersonList(purchaseNoticePerson);
|
||||
|
||||
return purchaseNoticePeople;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增新购短信通知人员purchase_notice_person
|
||||
*
|
||||
* @param purchaseNoticePerson 新购短信通知人员purchase_notice_person
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertPurchaseNoticePerson(PurchaseNoticePerson purchaseNoticePerson)
|
||||
{
|
||||
return purchaseNoticePersonMapper.insertPurchaseNoticePerson(purchaseNoticePerson);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改新购短信通知人员purchase_notice_person
|
||||
*
|
||||
* @param purchaseNoticePerson 新购短信通知人员purchase_notice_person
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updatePurchaseNoticePerson(PurchaseNoticePerson purchaseNoticePerson)
|
||||
{
|
||||
return purchaseNoticePersonMapper.updatePurchaseNoticePerson(purchaseNoticePerson);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除新购短信通知人员purchase_notice_person
|
||||
*
|
||||
* @param ids 需要删除的新购短信通知人员purchase_notice_person主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deletePurchaseNoticePersonByIds(Long[] ids)
|
||||
{
|
||||
return purchaseNoticePersonMapper.deletePurchaseNoticePersonByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除新购短信通知人员purchase_notice_person信息
|
||||
*
|
||||
* @param id 新购短信通知人员purchase_notice_person主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deletePurchaseNoticePersonById(Long id)
|
||||
{
|
||||
return purchaseNoticePersonMapper.deletePurchaseNoticePersonById(id);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,72 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.bonus.sgzb.system.mapper.PurchaseNoticePersonMapper">
|
||||
|
||||
<resultMap type="com.bonus.sgzb.system.domain.PurchaseNoticePerson" id="PurchaseNoticePersonResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="userId" column="user_id" />
|
||||
<result property="userName" column="user_name" />
|
||||
<result property="telphone" column="telphone" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectPurchaseNoticePersonVo">
|
||||
select id, user_id, user_name, telphone from purchase_notice_person
|
||||
</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 r.role_id = #{roleId} and u.status = '0'
|
||||
|
||||
</select>
|
||||
|
||||
<select id="selectPurchaseNoticePersonById" parameterType="Long" resultMap="PurchaseNoticePersonResult">
|
||||
<include refid="selectPurchaseNoticePersonVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertPurchaseNoticePerson" parameterType="com.bonus.sgzb.system.domain.PurchaseNoticePerson">
|
||||
insert into purchase_notice_person
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">id,</if>
|
||||
<if test="userId != null">user_id,</if>
|
||||
<if test="userName != null">user_name,</if>
|
||||
<if test="telphone != null">telphone,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">#{id},</if>
|
||||
<if test="userId != null">#{userId},</if>
|
||||
<if test="userName != null">#{userName},</if>
|
||||
<if test="telphone != null">#{telphone},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updatePurchaseNoticePerson" parameterType="com.bonus.sgzb.system.domain.PurchaseNoticePerson">
|
||||
update purchase_notice_person
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="userId != null">user_id = #{userId},</if>
|
||||
<if test="userName != null">user_name = #{userName},</if>
|
||||
<if test="telphone != null">telphone = #{telphone},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deletePurchaseNoticePersonById" parameterType="Long">
|
||||
delete from purchase_notice_person where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deletePurchaseNoticePersonByIds" parameterType="String">
|
||||
delete from purchase_notice_person where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
|
|
@ -228,6 +228,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time,
|
||||
u.remark
|
||||
from sys_user u
|
||||
where u.status = '0' and u.del_flag = '0'
|
||||
left join sys_user_role sur on u.user_id = sur.user_id
|
||||
where u.status = '0' and u.del_flag = '0' and sur.role_id = #{roleId}
|
||||
</select>
|
||||
</mapper>
|
||||
Loading…
Reference in New Issue