|
|
|
@ -1,5 +1,6 @@ |
|
|
|
|
package com.hfkj.service.item.impl; |
|
|
|
|
|
|
|
|
|
import com.hfkj.common.QRCodeGenerator; |
|
|
|
|
import com.hfkj.common.exception.ErrorCode; |
|
|
|
|
import com.hfkj.common.exception.ErrorHelp; |
|
|
|
|
import com.hfkj.common.exception.SysCode; |
|
|
|
@ -13,6 +14,8 @@ import com.hfkj.sysenum.SecUserStatusEnum; |
|
|
|
|
import org.apache.commons.collections4.MapUtils; |
|
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
import org.springframework.transaction.annotation.Propagation; |
|
|
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
|
|
|
|
|
|
import javax.annotation.Resource; |
|
|
|
|
import java.util.*; |
|
|
|
@ -27,6 +30,7 @@ public class EnTransportCompanyCarServiceImpl implements EnTransportCompanyCarSe |
|
|
|
|
private SecUserService secUserService; |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
@Transactional(propagation= Propagation.REQUIRES_NEW,rollbackFor= {RuntimeException.class}) |
|
|
|
|
public void create(EnTransportCompanyCar enTransportCompanyCar) throws Exception { |
|
|
|
|
enTransportCompanyCarMapper.insert(enTransportCompanyCar); |
|
|
|
|
|
|
|
|
@ -34,6 +38,17 @@ public class EnTransportCompanyCarServiceImpl implements EnTransportCompanyCarSe |
|
|
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "登录账户已存在,请更换"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// 生成二维码
|
|
|
|
|
String url = "carId="; |
|
|
|
|
String qrCodeImg = "carQrCode/" + enTransportCompanyCar.getId()+".png"; |
|
|
|
|
String qrCodeUrl = "/home/project/en-server/filesystem/" + qrCodeImg; |
|
|
|
|
QRCodeGenerator.generateQRCodeImage(url+enTransportCompanyCar.getId(), 350, 350, qrCodeUrl); |
|
|
|
|
enTransportCompanyCar.setQrImg(qrCodeImg); |
|
|
|
|
|
|
|
|
|
enTransportCompanyCar.setUpdateUser(enTransportCompanyCar.getCreateUser()); |
|
|
|
|
enTransportCompanyCar.setUpdateUserName(enTransportCompanyCar.getCreateUserName()); |
|
|
|
|
updateDate(enTransportCompanyCar); |
|
|
|
|
|
|
|
|
|
SecUser secUser = new SecUser(); |
|
|
|
|
secUser.setUserName(enTransportCompanyCar.getPerson()); |
|
|
|
|
secUser.setCreateTimeUserId(enTransportCompanyCar.getCreateUser()); |
|
|
|
@ -59,6 +74,11 @@ public class EnTransportCompanyCarServiceImpl implements EnTransportCompanyCarSe |
|
|
|
|
secUserService.editUser(secUser); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public void updateDate(EnTransportCompanyCar enTransportCompanyCar) { |
|
|
|
|
enTransportCompanyCarMapper.updateByPrimaryKey(enTransportCompanyCar); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public void delete(Long id, Boolean fullDelete) { |
|
|
|
|
EnTransportCompanyCar enTransportCompanyCar = queryDetail(id); |
|
|
|
|