Commit 438b6b92 by 吴迪

【新增】修改方法

parent 46441157
...@@ -3,6 +3,7 @@ package io.office.modules.manage.controller; ...@@ -3,6 +3,7 @@ package io.office.modules.manage.controller;
import io.office.common.utils.R; import io.office.common.utils.R;
import io.office.modules.app.annotation.Login; import io.office.modules.app.annotation.Login;
import io.office.modules.manage.entity.GS1CodeListEntity; import io.office.modules.manage.entity.GS1CodeListEntity;
import io.office.modules.manage.entity.dto.CreateQRcodeVo;
import io.office.modules.manage.service.BarcodeGenerationService; import io.office.modules.manage.service.BarcodeGenerationService;
import io.office.modules.manage.utils.CheckAICodeUtil; import io.office.modules.manage.utils.CheckAICodeUtil;
import io.office.modules.manage.vo.request.CheckAIVo; import io.office.modules.manage.vo.request.CheckAIVo;
...@@ -33,11 +34,11 @@ public class BarcodeGenerationController { ...@@ -33,11 +34,11 @@ public class BarcodeGenerationController {
*/ */
@Login @Login
@PostMapping("/api/createQRcode") @PostMapping("/api/createQRcode")
public R createQRcode(@RequestBody String[] param) { public R createQRcode(@RequestBody CreateQRcodeVo createQRcodeVo ) {
if(param.length==0){ if(createQRcodeVo.getParam().size()==0){
return R.error("参数有误"); return R.error("参数有误");
} }
String url = this.barcodeGenerationService.createPicture(param); String url = this.barcodeGenerationService.createPicture(createQRcodeVo.getParam().toArray());
return R.ok().put("data", url); return R.ok().put("data", url);
} }
@Login @Login
......
package io.office.modules.manage.entity.dto;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
*
* 
 @description:
*
* @author wudi
* @date 17:58 2021/12/20
*/
@Data
public class CreateQRcodeVo implements Serializable {
private List<String> param;
}
...@@ -13,7 +13,7 @@ import java.util.List; ...@@ -13,7 +13,7 @@ import java.util.List;
*/ */
@Service @Service
public interface BarcodeGenerationService { public interface BarcodeGenerationService {
String createPicture(String[] param); String createPicture(Object[] param);
List<GS1CodeListEntity> getGS1CodeListSSCC(); List<GS1CodeListEntity> getGS1CodeListSSCC();
......
...@@ -23,12 +23,12 @@ public class BarcodeGenerationServiceImpl implements BarcodeGenerationService { ...@@ -23,12 +23,12 @@ public class BarcodeGenerationServiceImpl implements BarcodeGenerationService {
public static final String prefix_url= "barcodegeneration/api/gensvg?type="; public static final String prefix_url= "barcodegeneration/api/gensvg?type=";
@Override @Override
public String createPicture(String[] param) { public String createPicture(Object[] param) {
String content=""; String content="";
//遍历参数数组 //遍历参数数组
for (int i = 0; i < param.length; i++) { for (int i = 0; i < param.length; i++) {
//获取ai标识符 //获取ai标识符
String[] split = param[i].split(","); String[] split = param[i].toString().split(",");
String aiCode=split[0]; String aiCode=split[0];
//根据ai标识符查ai详情 //根据ai标识符查ai详情
GS1CodeListEntity fixedLengthResult = qRcodeDao.getFixedLengthResult(aiCode); GS1CodeListEntity fixedLengthResult = qRcodeDao.getFixedLengthResult(aiCode);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment