物料后端和大屏接口
This commit is contained in:
parent
b16e42baf5
commit
9ec6f49fd9
|
|
@ -95,17 +95,21 @@ public class MaterialController extends BaseController {
|
|||
// @PreAuthorize("@ss.hasPermi('system:material:edit')")
|
||||
@Log(title = "修改宣传物料信息", businessType = BusinessType.UPDATE)
|
||||
@PostMapping("/edit")
|
||||
public AjaxResult edit(@RequestParam(value = "files",required = false) MultipartFile[] files,@RequestParam(value = "fileMsg") String fileMsg, @RequestParam(value = "params")String params) {
|
||||
public AjaxResult edit(@RequestParam(value = "files",required = false) MultipartFile[] files,@RequestParam(value = "fileMsg",required = false) String fileMsg, @RequestParam(value = "params")String params) {
|
||||
try {
|
||||
List<WebFileDto> listFile = FastJsonHelper.jsonArrStrToBeanList(fileMsg, WebFileDto.class);
|
||||
// 验证对应关系
|
||||
if (listFile != null && listFile.size() != files.length) {
|
||||
if (listFile != null && files != null && listFile.size() != files.length) {
|
||||
return error("文件信息与文件数量不匹配或文件缺失");
|
||||
}
|
||||
//先将数据对应关系处理
|
||||
for (int i = 0; i < Objects.requireNonNull(listFile).size(); i++) {
|
||||
listFile.get(i).setFile(files[i]);
|
||||
if(listFile != null){
|
||||
for (int i = 0; i < listFile.size(); i++) {
|
||||
assert files != null;
|
||||
listFile.get(i).setFile(files[i]);
|
||||
}
|
||||
}
|
||||
|
||||
TbPromotionMaterial tbPromotionMaterial = FastJsonHelper.jsonStrToBean(params, TbPromotionMaterial.class);
|
||||
return toAjax(service.updateTbPromotionMaterial(tbPromotionMaterial,listFile));
|
||||
} catch (Exception e) {
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ import com.bonus.business.service.SelectService;
|
|||
import com.bonus.common.core.controller.BaseController;
|
||||
import com.bonus.common.core.domain.AjaxResult;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
|
|
@ -28,7 +29,7 @@ public class SelectController extends BaseController {
|
|||
* @return
|
||||
*/
|
||||
@PostMapping("/selectProduct")
|
||||
public AjaxResult selectProduct(MapBeanPo po){
|
||||
public AjaxResult selectProduct(@RequestBody MapBeanPo po){
|
||||
try{
|
||||
return service.selectProduct(po);
|
||||
}catch (Exception e){
|
||||
|
|
|
|||
|
|
@ -133,7 +133,7 @@ public class TbPromotionMaterialServiceImpl implements ITbPromotionMaterialServi
|
|||
//将产品与物料关系存到另一张表
|
||||
List<TbPromotionMaterial> split = tbPromotionMaterial.split(tbPromotionMaterial);
|
||||
int n = mapper.insertMaterialProductRelevance(split);
|
||||
if(!listFiles.isEmpty()){
|
||||
if(listFiles != null && !listFiles.isEmpty()){
|
||||
//删除以前的附件
|
||||
if(tbPromotionMaterial.getDelIds() != null && !tbPromotionMaterial.getDelIds().isEmpty()){
|
||||
String[] splitId = tbPromotionMaterial.getDelIds().split(",");
|
||||
|
|
|
|||
Loading…
Reference in New Issue