This commit is contained in:
齐天大圣 2024-03-26 13:33:23 +08:00
parent 44f2479074
commit cf1caaa4c5
3 changed files with 13 additions and 6 deletions

View File

@ -132,13 +132,15 @@ public class TagCodeRecordController extends BaseController {
* @param id 主键结合
* @return 删除结果
*/
/* @DeleteMapping("id")
@DeleteMapping("id")
public ResponseObject delete(@PathVariable Long id) {
TagCodeRecord tagCodeRecord = this.tagCodeRecordService.getById(id);
if ()
//码牌id
Integer oilTagId = tagCodeRecord.getOilTagId();
return getSuccessResult(this.tagCodeRecordService.removeById(id));
}*/
if (ObjectUtils.isNotEmpty(tagCodeRecord.getStaffId())){
return getSuccessResult("该码牌已绑定员工,请先解绑员工!");
}else {
this.tagCodeRecordService.removeById(id);
return getSuccessResult("解绑成功!");
}
}
}

View File

@ -22,6 +22,7 @@ public class TagCode extends Model<TagCode> {
//主键id
@TableId(type = IdType.AUTO)
private Integer id;
private Integer deptId;
//二维码SN号
private String tagCodeSn;
//图片地址

View File

@ -7,7 +7,9 @@ import com.fuint.business.tag.dto.TagCodeDTO;
import com.fuint.business.tag.mapper.TagCodeMapper;
import com.fuint.business.tag.entity.TagCode;
import com.fuint.business.tag.service.TagCodeService;
import com.fuint.common.dto.AccountInfo;
import com.fuint.common.util.DateUtil;
import com.fuint.common.util.TokenUtil;
import com.fuint.module.backendApi.controller.BackendFileController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.io.InputStreamResource;
@ -60,6 +62,7 @@ public class TagCodeServiceImpl extends ServiceImpl<TagCodeMapper, TagCode> impl
@Transactional
public ResponseEntity<InputStreamResource> add(TagCodeDTO tagCodeDTO, HttpServletRequest request, HttpServletResponse response) throws Exception {
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
boolean flag = false;
if (ObjectUtils.isNotEmpty(tagCodeDTO) && ObjectUtils.isNotEmpty(tagCodeDTO.getTotal())){
int total = tagCodeDTO.getTotal();
@ -79,6 +82,7 @@ public class TagCodeServiceImpl extends ServiceImpl<TagCodeMapper, TagCode> impl
tagCode.setCollection(url);
tagCode.setTagCodeSn("byx"+i1);
tagCode.setDeptId(Integer.parseInt(nowAccountInfo.getDeptId().toString()));
//在图片上生成二维码
String backgroundImage = "static/qrCodeImg/huanyingguanglin2.jpg";