|
@@ -28,9 +28,6 @@ public class AuthTemplateApi {
|
|
|
|
|
|
private final AuthTemplateService authTemplateService;
|
|
private final AuthTemplateService authTemplateService;
|
|
|
|
|
|
- /**
|
|
|
|
- * 授权牌模板列表
|
|
|
|
- */
|
|
|
|
@ApiOperation("授权牌模板列表")
|
|
@ApiOperation("授权牌模板列表")
|
|
@ApiImplicitParams({
|
|
@ApiImplicitParams({
|
|
@ApiImplicitParam(name = "listType", required = true, value = "列表类型:1管理员列表,2供应商列表"),
|
|
@ApiImplicitParam(name = "listType", required = true, value = "列表类型:1管理员列表,2供应商列表"),
|
|
@@ -45,10 +42,26 @@ public class AuthTemplateApi {
|
|
return authTemplateService.getTemplateList(listType, authUserId, pageNum, pageSize);
|
|
return authTemplateService.getTemplateList(listType, authUserId, pageNum, pageSize);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ @ApiOperation("授权牌模板表单")
|
|
|
|
+ @ApiImplicitParams({
|
|
|
|
+ @ApiImplicitParam(name = "templateId", required = false, value = "模板id"),
|
|
|
|
+ @ApiImplicitParam(name = "authId", required = false, value = "机构id"),
|
|
|
|
+ @ApiImplicitParam(name = "authUserId", required = false, value = "供应商用户id"),
|
|
|
|
+ @ApiImplicitParam(name = "authFlag", required = false, value = "是否作为机构授权牌模板:1是0否"),
|
|
|
|
+ @ApiImplicitParam(name = "status", required = false, value = "启用状态:0停用,1启用")
|
|
|
|
+ })
|
|
|
|
+ @GetMapping("/form/data")
|
|
|
|
+ public ResponseJson<TemplateVo> getTemplateFormData(Integer templateId, Integer authId, Integer authUserId, Integer authFlag, Integer status) {
|
|
|
|
+ if (null == templateId && null == authId && null == authUserId) {
|
|
|
|
+ return ResponseJson.error("参数异常", null);
|
|
|
|
+ }
|
|
|
|
+ return authTemplateService.getTemplateFormData(templateId, authId, authUserId, authFlag, status);
|
|
|
|
+ }
|
|
|
|
+
|
|
@ApiOperation("添加/编辑授权模板")
|
|
@ApiOperation("添加/编辑授权模板")
|
|
@ApiImplicitParam(name = "params", required = true, value = "templateId:模板id;templateImage:模板图片;" +
|
|
@ApiImplicitParam(name = "params", required = true, value = "templateId:模板id;templateImage:模板图片;" +
|
|
"authUserId:供应商用户id;status:状态:1启用,0停用;qrPosition:二维码位置;qrSize:二维码尺寸;" +
|
|
"authUserId:供应商用户id;status:状态:1启用,0停用;qrPosition:二维码位置;qrSize:二维码尺寸;" +
|
|
- "authFlag:1设置为机构授权牌模板;productFlag:1设置为设备授权牌模板")
|
|
|
|
|
|
+ "logoSize:logo尺寸;authFlag:1设置为机构授权牌模板;productFlag:1设置为设备授权牌模板")
|
|
@PostMapping("/save")
|
|
@PostMapping("/save")
|
|
public ResponseJson saveTemplate(@RequestBody String params){
|
|
public ResponseJson saveTemplate(@RequestBody String params){
|
|
JSONObject parseObject = JSONObject.parseObject(params);
|
|
JSONObject parseObject = JSONObject.parseObject(params);
|
|
@@ -58,14 +71,23 @@ public class AuthTemplateApi {
|
|
Integer status = parseObject.getInteger("status");
|
|
Integer status = parseObject.getInteger("status");
|
|
String qrPosition = parseObject.getString("qrPosition");
|
|
String qrPosition = parseObject.getString("qrPosition");
|
|
Integer qrSize = parseObject.getInteger("qrSize");
|
|
Integer qrSize = parseObject.getInteger("qrSize");
|
|
|
|
+ String logoSize = parseObject.getString("logoSize");
|
|
Integer authFlag = parseObject.getInteger("authFlag");
|
|
Integer authFlag = parseObject.getInteger("authFlag");
|
|
Integer productFlag = parseObject.getInteger("productFlag");
|
|
Integer productFlag = parseObject.getInteger("productFlag");
|
|
if (null != templateId) {
|
|
if (null != templateId) {
|
|
if ((null != authFlag || null != productFlag) && null == authUserId) {
|
|
if ((null != authFlag || null != productFlag) && null == authUserId) {
|
|
return ResponseJson.error("供应商用户id不能为空");
|
|
return ResponseJson.error("供应商用户id不能为空");
|
|
}
|
|
}
|
|
|
|
+ } else {
|
|
|
|
+ if (StringUtils.isEmpty(templateImage)) {
|
|
|
|
+ return ResponseJson.error("模板图片不能为空");
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if (StringUtils.isEmpty(qrPosition)) {
|
|
|
|
+ // 默认左上角
|
|
|
|
+ qrPosition = "0,0";
|
|
}
|
|
}
|
|
- return authTemplateService.saveTemplate(templateId, templateImage, authUserId, status, qrPosition, qrSize, authFlag, productFlag);
|
|
|
|
|
|
+ return authTemplateService.saveTemplate(templateId, templateImage, authUserId, status, qrPosition, qrSize, logoSize, authFlag, productFlag);
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
}
|