添加出库时开启序列号的商品强制附加使用序列号
This commit is contained in:
@@ -1,152 +1,152 @@
|
||||
package com.jsh.erp.controller;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.jsh.erp.datasource.entities.Depot;
|
||||
import com.jsh.erp.service.depot.DepotService;
|
||||
import com.jsh.erp.service.userBusiness.UserBusinessService;
|
||||
import com.jsh.erp.utils.BaseResponseInfo;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.dao.DataAccessException;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author ji sheng hua 752*718*920
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping(value = "/depot")
|
||||
public class DepotController {
|
||||
private Logger logger = LoggerFactory.getLogger(DepotController.class);
|
||||
|
||||
@Resource
|
||||
private DepotService depotService;
|
||||
|
||||
@Resource
|
||||
private UserBusinessService userBusinessService;
|
||||
|
||||
@GetMapping(value = "/getAllList")
|
||||
public BaseResponseInfo getAllList(HttpServletRequest request) {
|
||||
BaseResponseInfo res = new BaseResponseInfo();
|
||||
try {
|
||||
List<Depot> depotList = depotService.getAllList();
|
||||
res.code = 200;
|
||||
res.data = depotList;
|
||||
} catch(Exception e){
|
||||
e.printStackTrace();
|
||||
res.code = 500;
|
||||
res.data = "获取数据失败";
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户对应仓库显示
|
||||
* @param type
|
||||
* @param keyId
|
||||
* @param request
|
||||
* @return
|
||||
*/
|
||||
@PostMapping(value = "/findUserDepot")
|
||||
public JSONArray findUserDepot(@RequestParam("UBType") String type, @RequestParam("UBKeyId") String keyId,
|
||||
HttpServletRequest request) {
|
||||
JSONArray arr = new JSONArray();
|
||||
try {
|
||||
List<Depot> dataList = depotService.findUserDepot();
|
||||
//开始拼接json数据
|
||||
JSONObject outer = new JSONObject();
|
||||
outer.put("id", 1);
|
||||
outer.put("text", "仓库列表");
|
||||
outer.put("state", "open");
|
||||
//存放数据json数组
|
||||
JSONArray dataArray = new JSONArray();
|
||||
if (null != dataList) {
|
||||
for (Depot depot : dataList) {
|
||||
JSONObject item = new JSONObject();
|
||||
item.put("id", depot.getId());
|
||||
item.put("text", depot.getName());
|
||||
//勾选判断1
|
||||
Boolean flag = false;
|
||||
try {
|
||||
flag = userBusinessService.checkIsUserBusinessExist(type, keyId, "[" + depot.getId().toString() + "]");
|
||||
} catch (Exception e) {
|
||||
logger.error(">>>>>>>>>>>>>>>>>设置用户对应的仓库:类型" + type + " KeyId为: " + keyId + " 存在异常!");
|
||||
}
|
||||
if (flag == true) {
|
||||
item.put("checked", true);
|
||||
}
|
||||
//结束
|
||||
dataArray.add(item);
|
||||
}
|
||||
}
|
||||
outer.put("children", dataArray);
|
||||
arr.add(outer);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return arr;
|
||||
}
|
||||
|
||||
@GetMapping(value = "/findDepotByUserId")
|
||||
public JSONArray findDepotByUserId(@RequestParam("UBType") String type, @RequestParam("UBKeyId") String keyId,
|
||||
HttpServletRequest request) {
|
||||
JSONArray arr = new JSONArray();
|
||||
try {
|
||||
List<Depot> dataList = depotService.findUserDepot();
|
||||
//开始拼接json数据
|
||||
if (null != dataList) {
|
||||
for (Depot depot : dataList) {
|
||||
JSONObject item = new JSONObject();
|
||||
//勾选判断1
|
||||
Boolean flag = false;
|
||||
try {
|
||||
flag = userBusinessService.checkIsUserBusinessExist(type, keyId, "[" + depot.getId().toString() + "]");
|
||||
} catch (DataAccessException e) {
|
||||
logger.error(">>>>>>>>>>>>>>>>>查询用户对应的仓库:类型" + type + " KeyId为: " + keyId + " 存在异常!");
|
||||
}
|
||||
if (flag == true) {
|
||||
item.put("id", depot.getId());
|
||||
item.put("depotName", depot.getName());
|
||||
arr.add(item);
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return arr;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查找礼品卡-虚拟仓库
|
||||
* @param type
|
||||
* @param request
|
||||
* @return
|
||||
*/
|
||||
@PostMapping(value = "/findGiftByType")
|
||||
public JSONArray findGiftByType(@RequestParam("type") Integer type,
|
||||
HttpServletRequest request) {
|
||||
JSONArray arr = new JSONArray();
|
||||
try {
|
||||
List<Depot> dataList = depotService.findGiftByType(type);
|
||||
//存放数据json数组
|
||||
if (null != dataList) {
|
||||
for (Depot depot : dataList) {
|
||||
JSONObject item = new JSONObject();
|
||||
item.put("id", depot.getId());
|
||||
//仓库名称
|
||||
item.put("name", depot.getName());
|
||||
arr.add(item);
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
logger.error(">>>>>>>>>查找仓库信息异常", e);
|
||||
}
|
||||
return arr;
|
||||
}
|
||||
}
|
||||
package com.jsh.erp.controller;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.jsh.erp.datasource.entities.Depot;
|
||||
import com.jsh.erp.service.depot.DepotService;
|
||||
import com.jsh.erp.service.userBusiness.UserBusinessService;
|
||||
import com.jsh.erp.utils.BaseResponseInfo;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.dao.DataAccessException;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author ji sheng hua 752*718*920
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping(value = "/depot")
|
||||
public class DepotController {
|
||||
private Logger logger = LoggerFactory.getLogger(DepotController.class);
|
||||
|
||||
@Resource
|
||||
private DepotService depotService;
|
||||
|
||||
@Resource
|
||||
private UserBusinessService userBusinessService;
|
||||
|
||||
@GetMapping(value = "/getAllList")
|
||||
public BaseResponseInfo getAllList(HttpServletRequest request) {
|
||||
BaseResponseInfo res = new BaseResponseInfo();
|
||||
try {
|
||||
List<Depot> depotList = depotService.getAllList();
|
||||
res.code = 200;
|
||||
res.data = depotList;
|
||||
} catch(Exception e){
|
||||
e.printStackTrace();
|
||||
res.code = 500;
|
||||
res.data = "获取数据失败";
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户对应仓库显示
|
||||
* @param type
|
||||
* @param keyId
|
||||
* @param request
|
||||
* @return
|
||||
*/
|
||||
@PostMapping(value = "/findUserDepot")
|
||||
public JSONArray findUserDepot(@RequestParam("UBType") String type, @RequestParam("UBKeyId") String keyId,
|
||||
HttpServletRequest request) {
|
||||
JSONArray arr = new JSONArray();
|
||||
try {
|
||||
List<Depot> dataList = depotService.findUserDepot();
|
||||
//开始拼接json数据
|
||||
JSONObject outer = new JSONObject();
|
||||
outer.put("id", 1);
|
||||
outer.put("text", "仓库列表");
|
||||
outer.put("state", "open");
|
||||
//存放数据json数组
|
||||
JSONArray dataArray = new JSONArray();
|
||||
if (null != dataList) {
|
||||
for (Depot depot : dataList) {
|
||||
JSONObject item = new JSONObject();
|
||||
item.put("id", depot.getId());
|
||||
item.put("text", depot.getName());
|
||||
//勾选判断1
|
||||
Boolean flag = false;
|
||||
try {
|
||||
flag = userBusinessService.checkIsUserBusinessExist(type, keyId, "[" + depot.getId().toString() + "]");
|
||||
} catch (Exception e) {
|
||||
logger.error(">>>>>>>>>>>>>>>>>设置用户对应的仓库:类型" + type + " KeyId为: " + keyId + " 存在异常!");
|
||||
}
|
||||
if (flag == true) {
|
||||
item.put("checked", true);
|
||||
}
|
||||
//结束
|
||||
dataArray.add(item);
|
||||
}
|
||||
}
|
||||
outer.put("children", dataArray);
|
||||
arr.add(outer);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return arr;
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/findDepotByUserId")
|
||||
public JSONArray findDepotByUserId(@RequestParam("UBType") String type, @RequestParam("UBKeyId") String keyId,
|
||||
HttpServletRequest request) {
|
||||
JSONArray arr = new JSONArray();
|
||||
try {
|
||||
List<Depot> dataList = depotService.findUserDepot();
|
||||
//开始拼接json数据
|
||||
if (null != dataList) {
|
||||
for (Depot depot : dataList) {
|
||||
JSONObject item = new JSONObject();
|
||||
//勾选判断1
|
||||
Boolean flag = false;
|
||||
try {
|
||||
flag = userBusinessService.checkIsUserBusinessExist(type, keyId, "[" + depot.getId().toString() + "]");
|
||||
} catch (DataAccessException e) {
|
||||
logger.error(">>>>>>>>>>>>>>>>>查询用户对应的仓库:类型" + type + " KeyId为: " + keyId + " 存在异常!");
|
||||
}
|
||||
if (flag == true) {
|
||||
item.put("id", depot.getId());
|
||||
item.put("depotName", depot.getName());
|
||||
arr.add(item);
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return arr;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查找礼品卡-虚拟仓库
|
||||
* @param type
|
||||
* @param request
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/findGiftByType")
|
||||
public JSONArray findGiftByType(@RequestParam("type") Integer type,
|
||||
HttpServletRequest request) {
|
||||
JSONArray arr = new JSONArray();
|
||||
try {
|
||||
List<Depot> dataList = depotService.findGiftByType(type);
|
||||
//存放数据json数组
|
||||
if (null != dataList) {
|
||||
for (Depot depot : dataList) {
|
||||
JSONObject item = new JSONObject();
|
||||
item.put("id", depot.getId());
|
||||
//仓库名称
|
||||
item.put("name", depot.getName());
|
||||
arr.add(item);
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
logger.error(">>>>>>>>>查找仓库信息异常", e);
|
||||
}
|
||||
return arr;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.jsh.erp.controller;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.jsh.erp.constants.ExceptionConstants;
|
||||
import com.jsh.erp.datasource.entities.DepotHead;
|
||||
import com.jsh.erp.datasource.vo.DepotHeadVo4InDetail;
|
||||
import com.jsh.erp.datasource.vo.DepotHeadVo4InOutMCount;
|
||||
@@ -464,5 +465,75 @@ public class DepotHeadController {
|
||||
}
|
||||
return allMoney;
|
||||
}
|
||||
/**
|
||||
* create by: cjl
|
||||
* description:
|
||||
* 新增单据主表及单据子表信息
|
||||
* create time: 2019/1/25 14:36
|
||||
* @Param: beanJson
|
||||
* @Param: inserted
|
||||
* @Param: deleted
|
||||
* @Param: updated
|
||||
* @return java.lang.String
|
||||
*/
|
||||
@RequestMapping(value = "/addDepotHeadAndDetail")
|
||||
public Object addDepotHeadAndDetail(@RequestParam("info") String beanJson,@RequestParam("inserted") String inserted,
|
||||
@RequestParam("deleted") String deleted,
|
||||
@RequestParam("updated") String updated) throws Exception{
|
||||
JSONObject result = ExceptionConstants.standardSuccess();
|
||||
depotHeadService.addDepotHeadAndDetail(beanJson,inserted,deleted,updated);
|
||||
return result;
|
||||
}
|
||||
/**
|
||||
* create by: cjl
|
||||
* description:
|
||||
* 更新单据主表及单据子表信息
|
||||
* create time: 2019/1/28 14:47
|
||||
* @Param: id
|
||||
* @Param: beanJson
|
||||
* @Param: inserted
|
||||
* @Param: deleted
|
||||
* @Param: updated
|
||||
* @Param: preTotalPrice
|
||||
* @return java.lang.Object
|
||||
*/
|
||||
@RequestMapping(value = "/updateDepotHeadAndDetail")
|
||||
public Object updateDepotHeadAndDetail(@RequestParam("id") Long id,@RequestParam("info") String beanJson,@RequestParam("inserted") String inserted,
|
||||
@RequestParam("deleted") String deleted,
|
||||
@RequestParam("updated") String updated,@RequestParam("preTotalPrice") BigDecimal preTotalPrice) throws Exception{
|
||||
|
||||
JSONObject result = ExceptionConstants.standardSuccess();
|
||||
depotHeadService.updateDepotHeadAndDetail(id,beanJson,inserted,deleted,updated,preTotalPrice);
|
||||
return result;
|
||||
}
|
||||
/**
|
||||
* create by: cjl
|
||||
* description:
|
||||
* 删除单据主表及子表信息
|
||||
* create time: 2019/1/28 17:29
|
||||
* @Param: id
|
||||
* @return java.lang.Object
|
||||
*/
|
||||
@RequestMapping(value = "/deleteDepotHeadAndDetail")
|
||||
public Object deleteDepotHeadAndDetail(@RequestParam("id") Long id) throws Exception{
|
||||
|
||||
JSONObject result = ExceptionConstants.standardSuccess();
|
||||
depotHeadService.deleteDepotHeadAndDetail(id);
|
||||
return result;
|
||||
}
|
||||
/**
|
||||
* create by: cjl
|
||||
* description:
|
||||
* 删除单据主表及子表信息
|
||||
* create time: 2019/1/28 17:29
|
||||
* @Param: id
|
||||
* @return java.lang.Object
|
||||
*/
|
||||
@RequestMapping(value = "/batchDeleteDepotHeadAndDetail")
|
||||
public Object batchDeleteDepotHeadAndDetail(@RequestParam("ids") String ids) throws Exception{
|
||||
|
||||
JSONObject result = ExceptionConstants.standardSuccess();
|
||||
depotHeadService.batchDeleteDepotHeadAndDetail(ids);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -262,7 +262,7 @@ public class DepotItemController {
|
||||
@RequestParam("deleted") String deleted,
|
||||
@RequestParam("updated") String updated,
|
||||
@RequestParam("headerId") Long headerId,
|
||||
HttpServletRequest request) {
|
||||
HttpServletRequest request) throws Exception{
|
||||
Map<String, Object> objectMap = new HashMap<String, Object>();
|
||||
try {
|
||||
depotItemService.saveDetials(inserted,deleted,updated,headerId);
|
||||
|
||||
@@ -176,7 +176,12 @@ public class SupplierController {
|
||||
item.put("AdvanceIn", supplier.getAdvancein());
|
||||
item.put("BeginNeedGet", supplier.getBeginneedget());
|
||||
item.put("BeginNeedPay", supplier.getBeginneedpay());
|
||||
item.put("isystem", supplier.getIsystem() == (short) 0 ? "是" : "否");
|
||||
/**
|
||||
* 2018-01-28这里会有空指针异常
|
||||
* */
|
||||
if(supplier.getIsystem()!=null){
|
||||
item.put("isystem", supplier.getIsystem() == (short) 0 ? "是" : "否");
|
||||
}
|
||||
item.put("description", supplier.getDescription());
|
||||
item.put("fax", supplier.getFax());
|
||||
item.put("telephone", supplier.getTelephone());
|
||||
|
||||
Reference in New Issue
Block a user