Commit 95997a0d by zhanglt

Merge branch 'master' of http://gitlab.yqdchina.com/huyi/warehouse into zlt

parents 667689a8 e1c2204f
...@@ -128,7 +128,6 @@ public class GoodsService extends CrudService<GoodsMapper, Goods> { ...@@ -128,7 +128,6 @@ public class GoodsService extends CrudService<GoodsMapper, Goods> {
qrCode.setGoodsInfo(goodsInfo); qrCode.setGoodsInfo(goodsInfo);
qrCode.setState("0"); qrCode.setState("0");
qrCode.setGoodsInfo(goodsInfo);
qrCode.preInsert(); qrCode.preInsert();
try { try {
BuildQcUtil.buildQr(qrCode, qrImgPath + "/" + numSeq + ".png", qrImgPath + "/" + numSeq + "_" + i + ".png"); // 生成图片 BuildQcUtil.buildQr(qrCode, qrImgPath + "/" + numSeq + ".png", qrImgPath + "/" + numSeq + "_" + i + ".png"); // 生成图片
...@@ -138,6 +137,7 @@ public class GoodsService extends CrudService<GoodsMapper, Goods> { ...@@ -138,6 +137,7 @@ public class GoodsService extends CrudService<GoodsMapper, Goods> {
qrCode.setUrl(Global.getAttachmentUrl() + "image/" + numSeq + "_" + i + ".png"); qrCode.setUrl(Global.getAttachmentUrl() + "image/" + numSeq + "_" + i + ".png");
qrCodeMapper.insert(qrCode); qrCodeMapper.insert(qrCode);
qrCode = qrCodeMapper.get(qrCode.getId());
qrCodeList.add(qrCode); qrCodeList.add(qrCode);
} }
...@@ -148,7 +148,7 @@ public class GoodsService extends CrudService<GoodsMapper, Goods> { ...@@ -148,7 +148,7 @@ public class GoodsService extends CrudService<GoodsMapper, Goods> {
qrInterval = beginNumSeq + "_" + endNumSeq.substring(13,17); qrInterval = beginNumSeq + "_" + endNumSeq.substring(13,17);
} }
goodsInfo.setQrInterval(qrInterval); // 设置编码区间 goodsInfo.setQrInterval(qrInterval); // 设置编码区间
goodsInfo.preUpdate(); // goodsInfo.preUpdate();
goodsInfoMapper.update(goodsInfo); goodsInfoMapper.update(goodsInfo);
goodsInfo.setQrCodeList(qrCodeList); goodsInfo.setQrCodeList(qrCodeList);
return goodsInfo; return goodsInfo;
...@@ -174,7 +174,12 @@ public class GoodsService extends CrudService<GoodsMapper, Goods> { ...@@ -174,7 +174,12 @@ public class GoodsService extends CrudService<GoodsMapper, Goods> {
String url = qrCode.getUrl(); String url = qrCode.getUrl();
if (null != url && url.contains("image")) { if (null != url && url.contains("image")) {
String photo = url.split("image/")[1]; String photo = url.split("image/")[1];
File file = new File(Global.getAttachmentDir() + "image/" + photo);
if (file.exists()) {
FileUtil.deleteFile(new File(Global.getAttachmentDir() + "image/" + photo)); FileUtil.deleteFile(new File(Global.getAttachmentDir() + "image/" + photo));
} else {
logger.info("二维码路径不存在,执行删除");
}
} }
} catch (IOException e) { } catch (IOException e) {
e.printStackTrace(); e.printStackTrace();
......
...@@ -50,7 +50,7 @@ public class IKSegmenterTest { ...@@ -50,7 +50,7 @@ public class IKSegmenterTest {
return strs; return strs;
} }
public static void main(String[] args) { public static void main(String[] args) {
String text = "185的绿军鞋15双"; String text = "185的绿军鞋15双";
System.out.println("使用智能分词结果:"+splitStr(text, true)); System.out.println("使用智能分词结果:"+splitStr(text, true));
System.out.println("最细粒度分词结果:"+splitStr(text, false)); System.out.println("最细粒度分词结果:"+splitStr(text, false));
} }
......
...@@ -219,7 +219,7 @@ public class StorageService extends CrudService<StorageMapper, Storage> { ...@@ -219,7 +219,7 @@ public class StorageService extends CrudService<StorageMapper, Storage> {
* @return * @return
*/ */
@Transactional(readOnly = false) @Transactional(readOnly = false)
public List<StorageInfo> findByPcTypeModel(GoodsInfo goodsInfo) { public Page<StorageInfo> findByPcTypeModel(Page<StorageInfo> page, GoodsInfo goodsInfo) {
QrCode temQr = new QrCode(); QrCode temQr = new QrCode();
temQr.setGoodsInfo(goodsInfo); temQr.setGoodsInfo(goodsInfo);
List<QrCode> qrCodeList = qrCodeMapper.findByPcTypeModel(temQr); List<QrCode> qrCodeList = qrCodeMapper.findByPcTypeModel(temQr);
...@@ -236,6 +236,7 @@ public class StorageService extends CrudService<StorageMapper, Storage> { ...@@ -236,6 +236,7 @@ public class StorageService extends CrudService<StorageMapper, Storage> {
storageInfo.setQrCode(qrCode); storageInfo.setQrCode(qrCode);
storageInfoList.add(storageInfo); storageInfoList.add(storageInfo);
} }
return storageInfoList; page.setList(storageInfoList);
return page;
} }
} }
\ No newline at end of file
...@@ -18,6 +18,7 @@ import com.jeeplus.modules.warehouse.goods.entity.Goods; ...@@ -18,6 +18,7 @@ import com.jeeplus.modules.warehouse.goods.entity.Goods;
import com.jeeplus.modules.warehouse.goods.entity.GoodsInfo; import com.jeeplus.modules.warehouse.goods.entity.GoodsInfo;
import com.jeeplus.modules.warehouse.materialtype.entity.MaterialType; import com.jeeplus.modules.warehouse.materialtype.entity.MaterialType;
import com.jeeplus.modules.warehouse.qrcode.entity.QrCode; import com.jeeplus.modules.warehouse.qrcode.entity.QrCode;
import com.jeeplus.modules.warehouse.shelves.entity.Shelves;
import com.jeeplus.modules.warehouse.storage.dto.CountStorageInfo; import com.jeeplus.modules.warehouse.storage.dto.CountStorageInfo;
import com.jeeplus.modules.warehouse.storage.entity.StorageInfo; import com.jeeplus.modules.warehouse.storage.entity.StorageInfo;
import org.apache.shiro.authz.annotation.Logical; import org.apache.shiro.authz.annotation.Logical;
...@@ -261,28 +262,19 @@ public class StorageController extends BaseController { ...@@ -261,28 +262,19 @@ public class StorageController extends BaseController {
/** /**
* 查询需要入库的货品信息 * 查询需要入库的货品信息
* @param goodsInfo * @param storageInfo
* @return * @return
*/ */
@ResponseBody @ResponseBody
@RequestMapping(value = "findByPcTypeModel") @RequestMapping(value = "findByPcTypeModel")
public AjaxJson findByPcTypeModel(GoodsInfo goodsInfo) { public Map<String, Object> findByPcTypeModel(HttpServletRequest request, HttpServletResponse response, StorageInfo storageInfo) {
Goods goods = new Goods(); GoodsInfo goodsInfo = storageInfo.getGoodsInfo();
goods.setBatchNum("PC-2023-02-0003");
goodsInfo.setType(new MaterialType("3c56529c82bd49c38ebd27d5264af130"));
goodsInfo.setGoods(goods);
AjaxJson j = new AjaxJson();
if (null != goodsInfo && null != goodsInfo.getGoods() && null != goodsInfo.getType() && StringUtils.isNotBlank(goodsInfo.getGoods().getBatchNum()) && StringUtils.isNotBlank(goodsInfo.getType().getId())) { if (null != goodsInfo && null != goodsInfo.getGoods() && null != goodsInfo.getType() && StringUtils.isNotBlank(goodsInfo.getGoods().getBatchNum()) && StringUtils.isNotBlank(goodsInfo.getType().getId())) {
List<StorageInfo> storageInfoList = storageService.findByPcTypeModel(goodsInfo); Page<StorageInfo> page = storageService.findByPcTypeModel(new Page<StorageInfo>(request, response), goodsInfo);
j.put("storageInfoList", storageInfoList); return getBootstrapData(page);
j.setSuccess(true);
j.setMsg("查询成功");
} else { } else {
j.setSuccess(false); return null;
j.setMsg("查询条件不能为空");
} }
return j;
} }
} }
\ No newline at end of file
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