Commit 438b6b92 by 吴迪

【新增】修改方法

parent 46441157
......@@ -3,6 +3,7 @@ package io.office.modules.manage.controller;
import io.office.common.utils.R;
import io.office.modules.app.annotation.Login;
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.utils.CheckAICodeUtil;
import io.office.modules.manage.vo.request.CheckAIVo;
......@@ -33,11 +34,11 @@ public class BarcodeGenerationController {
*/
@Login
@PostMapping("/api/createQRcode")
public R createQRcode(@RequestBody String[] param) {
if(param.length==0){
public R createQRcode(@RequestBody CreateQRcodeVo createQRcodeVo ) {
if(createQRcodeVo.getParam().size()==0){
return R.error("参数有误");
}
String url = this.barcodeGenerationService.createPicture(param);
String url = this.barcodeGenerationService.createPicture(createQRcodeVo.getParam().toArray());
return R.ok().put("data", url);
}
@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;
*/
@Service
public interface BarcodeGenerationService {
String createPicture(String[] param);
String createPicture(Object[] param);
List<GS1CodeListEntity> getGS1CodeListSSCC();
......
......@@ -23,12 +23,12 @@ public class BarcodeGenerationServiceImpl implements BarcodeGenerationService {
public static final String prefix_url= "barcodegeneration/api/gensvg?type=";
@Override
public String createPicture(String[] param) {
public String createPicture(Object[] param) {
String content="";
//遍历参数数组
for (int i = 0; i < param.length; i++) {
//获取ai标识符
String[] split = param[i].split(",");
String[] split = param[i].toString().split(",");
String aiCode=split[0];
//根据ai标识符查ai详情
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