This commit is contained in:
sxu 2025-06-16 17:56:44 +08:00
parent b0ce1ed9e4
commit 04db38c4c8
4 changed files with 13 additions and 21 deletions

View File

@ -84,22 +84,6 @@ public class AccCardController extends BaseController {
}
}
/**
* 修改人员卡片资料
*/
@ApiOperation(value = "修改人员卡片资料")
//@PreventRepeatSubmit
//@RequiresPermissions("account:card:edit")
@SysLog(title = "人员卡片资料", businessType = OperaType.UPDATE, logType = 1,module = "仓储管理->修改人员卡片资料")
@PostMapping("/edit")
public AjaxResult edit(@RequestBody AccountCard accountCard) {
try {
return toAjax(accCardService.updateAccCard(accountCard));
} catch (Exception e) {
return error(e.getMessage());
}
}
@ApiOperation(value = "换卡")
//@PreventRepeatSubmit
//@RequiresPermissions("account:card:edit")

View File

@ -44,6 +44,11 @@ public class AccountCard extends BaseEntity {
@ApiModelProperty(value = "卡序列号 物理卡号")
private String serialNum;
/** 卡序列号 物理卡号 */
@Excel(name = "卡序列号 物理卡号")
@ApiModelProperty(value = "卡序列号 物理卡号")
private String newSerialNum;
/** 餐卡性质(临时卡、编制卡) */
@Excel(name = "餐卡性质", readConverterExp = "临=时卡、编制卡")
private String cardNature;

View File

@ -125,10 +125,12 @@ public class AccCardServiceImpl implements IAccCardService {
accountCard.setUpdateTime(DateUtils.getNowDate());
try {
// 发卡前校验是否卡号已存在, 卡号不能重复
int cardCountByCardSerialNum= accCardMapper.selectAccCardCountByCardSerialNum(accountCard.getSerialNum());
if (CardRecordTypeEnum.CHANGE.getKey().equals(accountCard.getOperationType())) {
int cardCountByCardSerialNum= accCardMapper.selectAccCardCountByCardSerialNum(accountCard.getNewSerialNum());
if (cardCountByCardSerialNum > 0) {
throw new ServiceException("卡号已存在, 卡号不能重复");
}
}
AccountInfo accountInfo = accInfoMapper.selectAccInfoById(accountCard.getAccountId());
checkAccInfoAndStatus(accountInfo);
int count = accCardMapper.updateAccCard(accountCard);

View File

@ -40,6 +40,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="productCost != null "> and ac.product_cost = #{productCost}</if>
<if test="validityDate != null "> and ac.validity_date = #{validityDate}</if>
</where>
order by ac.user_id, ac.serial_num
</select>
<select id="selectAccCardCountByUserId" parameterType="Long" resultType="Integer">
@ -98,7 +99,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<trim prefix="SET" suffixOverrides=",">
<if test="userId != null">user_id = #{userId},</if>
<if test="accountId != null">account_id = #{accountId},</if>
<if test="serialNum != null and serialNum != ''">serial_num = #{serialNum},</if>
<if test="serialNum != null and serialNum != ''">serial_num = #{newSerialNum},</if>
<if test="cardNature != null">card_nature = #{cardNature},</if>
<if test="cardType != null">card_type = #{cardType},</if>
<if test="cardStatus != null">card_status = #{cardStatus},</if>
@ -110,7 +111,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
</trim>
where account_id = #{accountId}
where account_id = #{accountId} and serial_num = #{serialNum}
</update>
<delete id="deleteAccCardById" parameterType="Long">