修复创建模板问题
This commit is contained in:
parent
297a97db9e
commit
92081f7035
@ -41,6 +41,7 @@ public class SysRecipesTemplateServiceImpl implements ISysRecipesTemplateService
|
|||||||
sysRecipesPlan.setStartNumDay(1);
|
sysRecipesPlan.setStartNumDay(1);
|
||||||
sysRecipesPlan.setEndNumDay(7);
|
sysRecipesPlan.setEndNumDay(7);
|
||||||
sysRecipesPlan.setType(1);
|
sysRecipesPlan.setType(1);
|
||||||
|
sysRecipesPlan.setCusId(0L);
|
||||||
sysRecipesPlanMapper.insertSysRecipesPlan(sysRecipesPlan);
|
sysRecipesPlanMapper.insertSysRecipesPlan(sysRecipesPlan);
|
||||||
if (!StringUtils.isNull(sysRecipesPlan.getId())) {
|
if (!StringUtils.isNull(sysRecipesPlan.getId())) {
|
||||||
sysRecipesTemplate.setCreateBy(SecurityUtils.getUsername());
|
sysRecipesTemplate.setCreateBy(SecurityUtils.getUsername());
|
||||||
@ -60,7 +61,15 @@ public class SysRecipesTemplateServiceImpl implements ISysRecipesTemplateService
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int removeRecipesTemplate(Long id) {
|
public int removeRecipesTemplate(Long id) {
|
||||||
return sysRecipesTemplateMapper.removeRecipesTemplate(id);
|
SysRecipesTemplate sysRecipesTemplate= sysRecipesTemplateMapper.getRecipesTemplateById(id);
|
||||||
|
if(StringUtils.isNull(sysRecipesTemplate)) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
int rows = sysRecipesTemplateMapper.removeRecipesTemplate(sysRecipesTemplate.getId());
|
||||||
|
if(rows > 0) {
|
||||||
|
return sysRecipesPlanMapper.deleteSysRecipesPlanById(sysRecipesTemplate.getPlanId());
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -132,9 +132,9 @@
|
|||||||
where id = #{id} and del_flag = 0
|
where id = #{id} and del_flag = 0
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
<delete id="deleteSysRecipesPlanById" parameterType="Long">
|
<update id="deleteSysRecipesPlanById" parameterType="Long">
|
||||||
delete from sys_recipes_plan where id = #{id}
|
update sys_recipes_plan set del_flag = 1 where id = #{id}
|
||||||
</delete>
|
</update>
|
||||||
|
|
||||||
<delete id="deleteSysRecipesPlanByIds" parameterType="String">
|
<delete id="deleteSysRecipesPlanByIds" parameterType="String">
|
||||||
delete from sys_recipes_plan where id in
|
delete from sys_recipes_plan where id in
|
||||||
|
@ -2,7 +2,7 @@ import request from "@/utils/request";
|
|||||||
|
|
||||||
export function addRecipesApi(data) {
|
export function addRecipesApi(data) {
|
||||||
return request({
|
return request({
|
||||||
url: "/custom/recipes/",
|
url: "/custom/recipes",
|
||||||
method: "post",
|
method: "post",
|
||||||
data
|
data
|
||||||
});
|
});
|
||||||
|
@ -259,9 +259,7 @@ const actions = {
|
|||||||
dispatch("getRecipesInfo", { recipesId });
|
dispatch("getRecipesInfo", { recipesId });
|
||||||
payload.callback &&
|
payload.callback &&
|
||||||
payload.callback({
|
payload.callback({
|
||||||
recipesId: result.data,
|
|
||||||
name: state.healthyData.name,
|
name: state.healthyData.name,
|
||||||
cusId: state.cusId,
|
|
||||||
planId: state.planId
|
planId: state.planId
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -72,7 +72,9 @@
|
|||||||
import BarChart from "./BarChart";
|
import BarChart from "./BarChart";
|
||||||
import PieChart from "./PieChart";
|
import PieChart from "./PieChart";
|
||||||
import { createNamespacedHelpers } from "vuex";
|
import { createNamespacedHelpers } from "vuex";
|
||||||
const { mapActions, mapState } = createNamespacedHelpers("recipes");
|
const { mapActions, mapState, mapMutations } = createNamespacedHelpers(
|
||||||
|
"recipes"
|
||||||
|
);
|
||||||
export default {
|
export default {
|
||||||
name: "RecipesAspectCom",
|
name: "RecipesAspectCom",
|
||||||
components: {
|
components: {
|
||||||
@ -96,8 +98,10 @@ export default {
|
|||||||
handleOnSave() {
|
handleOnSave() {
|
||||||
this.saveRecipes({
|
this.saveRecipes({
|
||||||
callback: (query) => {
|
callback: (query) => {
|
||||||
console.log(query);
|
// console.log(query);
|
||||||
this.$router.replace({ path: "/recipes/build", query });
|
this.$router.replace({
|
||||||
|
path: "/recipes/build/" + query.name + "/" + query.planId,
|
||||||
|
});
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
@ -105,9 +109,10 @@ export default {
|
|||||||
this.updateReviewStatus({ reviewStatus });
|
this.updateReviewStatus({ reviewStatus });
|
||||||
},
|
},
|
||||||
handleOnBack() {
|
handleOnBack() {
|
||||||
this.updateReviewStatus({ recipesData: [] });
|
this.updateStateData({ recipesData: [] });
|
||||||
},
|
},
|
||||||
...mapActions(["saveRecipes", "updateReviewStatus"]),
|
...mapActions(["saveRecipes", "updateReviewStatus"]),
|
||||||
|
...mapMutations(["updateStateData"]),
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
@ -430,6 +430,7 @@ export default {
|
|||||||
submitForm() {
|
submitForm() {
|
||||||
this.$refs["form"].validate((valid) => {
|
this.$refs["form"].validate((valid) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
|
this.form.cusId = 0;
|
||||||
if (this.form.id != null) {
|
if (this.form.id != null) {
|
||||||
updateRecipesTemplate(this.form).then((response) => {
|
updateRecipesTemplate(this.form).then((response) => {
|
||||||
if (response.code === 200) {
|
if (response.code === 200) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user